how do i read more than 7 records from a datagrid??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shahji121
    New Member
    • Jan 2010
    • 1

    how do i read more than 7 records from a datagrid??

    like, while using SqlDataReader.r ead() it can only get 7 rows of a gridview.

    I want to access more than 7 rows lets say 11.

    heres the code i have been so far

    While (reader.Read())
    Dim s() As String = _
    {reader.GetValu e(0).ToString, _
    reader.GetValue (1).ToString, _
    reader.GetValue (2).ToString, _
    reader.GetValue (3).ToString, _
    reader.GetValue (4).ToString, _
    reader.GetValue (5).ToString, _
    reader.GetValue (6).ToString}

    Dim item As New ListViewItem(s)
    ListView1.Items .Add(item)


    End While
  • marcellus7
    New Member
    • Oct 2008
    • 33

    #2
    You can loop through each row object in the grid and save the column that you need. Here's an example


    Dim dgRow As DataGridViewRow

    For each dgRow In DataGridView1.R ows
    ListView1.Items .Add(dgRow.Cell s.Item(2).Value .ToString())
    Next

    This adds the 3rd column (Item(2)) of the row to the ListView, and continues for every row in the DataGrid. You can change the loop, depending on how many you need, etc.

    Comment

    • kreativity
      New Member
      • Jan 2010
      • 1

      #3
      can anyone gimme the pgm for"how to read a .wav file in c++"??

      Comment

      Working...