Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to check the end of the record in Datareader?

Answers were Sorted based on User's Feedback



How to check the end of the record in Datareader?..

Answer / 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

How to check the end of the record in Datareader?..

Answer / bhagwat prasad sharma

{vb.net code for selection by data reader}
//\\Start......

imports system.data.sqlclients

public class

dim con as new sqlconnection("server=bps; database=college; user id=sa; password=admin")

private button1 ()

dim str as string="select
name from student where roll_no=1"

dim cmd as new sqlcommand(str,con)

if con.state=connectionstate.closed than
con.open()

cmd.parameters.add("@roll_no",type.int)

cmd.parameters("@roll_no").value=txtroll.text

dim dr as sqldatareader

dr=cmd.executereader

if dr.read than

txtname.text=dr(1)

else

msgbox("selection error ")

end if

con.close()

end sub

end class

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More ASP.NET Interview Questions

What is the difference between CC and BCC?

0 Answers   MCN Solutions,


What is the main use of Response.Output.Write()?

4 Answers   Siebel,


Define caching.

0 Answers  


what is diff between responseexpires and expiresabsolute

2 Answers   Accenture,


Difference between HTML control and Web Server Control?

4 Answers  


Can we handle the error and redirect to some pages using web.config?

1 Answers   BirlaSoft,


How do you add a javascript function for a link button in a datagrid?

2 Answers   Microsoft,


what is silver light when will we use silver light,

0 Answers  


Explain the asp.net page life cycle.

0 Answers  


Can we use multiple web.config files in an sigle appliction?

3 Answers   IBS,


In what order do the events of an ASPX page execute, As a developer is it important to understand these events?

4 Answers  


Define the steps to set up validation control.

0 Answers  


Categories