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.![]()





Reply With Quote