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

i want the asp.net technical questions and answeres

1611


Define dll hell?

631


How does a content page different from a master page?

582


Why would anyone need to implement their own hashtable or linked list?

2441


What is %20 in a url?

546






Describe how to implement globalization and localization in the use interface in .net.

568


Which object is used to encapsulate the state of the client and the browser in ASP.NET?

595


What are the modes of updation in an updatepanel? What are triggers of an updatepanel?

509


Define resource files.

565


How you can manage the state of application at the server side in ASP.NET?

582


Where sessions are stored?

659


What is masterpage?

514


What is the asp.net mvc folder conventions? : asp.net mvc

471


Explain global assembly cache.

579


What is autopostback in asp net?

593