How to check the end of the record in Datareader?

Answer Posted / anitha

Dim cmdstr As String
Dim cmdsql As New SqlClient.SqlCommand
Dim consql As SqlConnection = New
SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
cmdstr = "select top 1 columnName from tbl_Sample order by
ColumnName desc "
cmdsql = New SqlCommand(cmdstr, consql)
If consql.State = ConnectionState.Closed Then
consql.Open()
Dim drsql As SqlDataReader
drsql = cmdsql.ExecuteReader()
Do While drsql.Read
any Control value= drsql.Item(0)
Loop
drsql.Close()

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is global asax is used?

790


Does asp.net still recognize the global.asa file?

719


Is session stored in browser?

703


can s/w quality assurance engineer switch field to programming side i m very much interested in programming but not much good in it

1666


How does asp net store session ids by default?

701


What is http request and response?

709


Explain About duration in caching technique

823


What are the differences between clr & cts?

723


What is a reflection?

743


How do you handle server controls?

849


What are the options in ASP.NET to maintain state?

812


What are the different types of sessions in asp.net? Name them?

879


What is difference between ispostback and autopostback in asp net?

702


How do I know asp.net mvc version? : Asp.Net MVC

710


Which library is used by the testers and developers to develop automated tests and create testing tools?

740