title: How to manually add data in Gridview
body: <p>I have done this thing and it displays an error as <code>Index was out of range. Must be negative and non zero value.</code> In the following code,</p>
  
  <pre><code>Dim index_flag as Integer = 0
  GridView1.Rows(index_flag).Cells(1).Text = ds.Tables(0).Rows(index_flag).Item("curr_datetime").ToString
  GridView1.Rows(index_flag).Cells(2).Text = ds.Tables(0).Rows(index_flag).Item("site_id").ToString
  GridView1.Rows(index_flag).Cells(2).Text = ds.Tables(0).Rows(index_flag).Item("site_name").ToString
  GridView1.Rows(index_flag).Cells(3).Text = ds.Tables(0).Rows(index_flag).Item("dc_volt").ToString
  </code></pre>