Move to the last row of a table

How to move to the last row of a table in VB.Net

Questions by kuntal sarkar   answers by kuntal sarkar

Showing Answers 1 - 3 of 3 Answers

Behamcraq

  • May 3rd, 2008
 

If any one want to get the last row it simple:

Try

Dim cmd As New SqlCommand

cmd.CommandText = "SELECT Max(Tour_ID) FROM Tours"

cmd.CommandType = CommandType.Text

cmd.Connection = sconnect

sconnect.Open()

Label20.Text = cmd.ExecuteScalar()

Catch ex As SqlClient.SqlException

Finally

sconnect.Close()

End Try

in this example we have selected the last row and actually we have output it into the form by using label20.text

I hope it will be help full for you

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions