Results 1 to 15 of 15

Thread: [RESOLVED][2008] Need held on my Datagrid

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Resolved [RESOLVED][2008] Need held on my Datagrid

    Elow everyone I just want to know how to get the first five row on my datagrid and put in on a textboxes. I just got the First row but how can i get the next succeding row? I have my code upon getting my first row, how about the reamining 5 rows? Here is my code below

    Code:
     myConnection.Open()
    
                myAdapter.Fill(myDataset, "SalesMonitor")
                DataGridView1.DataSource = myDataset.Tables("SalesMonitor")
    
    
                Dim myReader As System.Data.SqlClient.SqlDataReader
                myReader = myCommand.ExecuteReader()
    
                Dim nCnt As Integer
                nCnt = 0
                While myReader.Read()
                    nCnt = nCnt + 1
    
                    If nCnt = 1 Then
                        txtStore1.Text = myReader.GetString(0)
                        lblAPQTY1.Text = myReader.GetDecimal(1)
                        lblAPAMT1.Text = myReader.GetDecimal(2)
                        lblMCQTY1.Text = myReader.GetDecimal(3)
                        lblMCAMT1.Text = myReader.GetDecimal(4)
                        lblATSQTY1.Text = myReader.GetDecimal(5)
                        lblATSAMT1.Text = myReader.GetDecimal(6)
                        lblFURQTY1.Text = myReader.GetDecimal(7)
                        lblFURAMT1.Text = myReader.GetDecimal(8)
                        lblPARTSQTY1.Text = myReader.GetDecimal(9)
                        lblPARTSAMT1.Text = myReader.GetDecimal(10)
                        lblDate1.Text = myReader.GetDateTime(11)
    
    
                    End If
    
                End While
    
                myReader.Close()
                myConnection.Close()

    How can i get the next four succeding row on my datagrid? Could anyone help me pls??? I really need it badly...Thanks in advance guys and have a pleasant morning 2 everyone.
    Last edited by shyguyjeff; May 25th, 2008 at 11:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width