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
What is asp.net globalization?
Differentiate between authentication and authorization.
How many types of sessions in asp.net?
What is the difference between user control and custom control?
What is difference between ispostback and autopostback in asp net?
How does asp.net work?
Explain diff between dataset and datareader?
How can you display all validation messages in one control?
Explain login controls.
How to prepare culture-specific formatting in .net.
What is meant by web application?
what is meant by sitemapnode ?
what are the events raised in asp.net page life cycle?in which stage view state can be loaded?
What are the benefits of Razor View?
What is the function used for removing an event listener?