How to check the end of the record in Datareader?
Answer Posted / 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 View All Answers
What is the procedure to create the environment for asp.net? : asp.net mvc
Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?
What are triggers of an updatepanel?
i want to implement grid view value in paypal site. so how to create this code in asp.net with C#
How do you implement postback with a text box?
How can we identify that the Page is Post Back?
What is the use of the tag in the web.config file?
How do you do Client-side validation in .Net?
Differences between “dataset” and “datareader”.
What is the recommended approach for asp.net mvc to globally intercept exceptions? What other functionality can be implemented with the approach? : Asp.Net MVC
Can we have a web application running without web.config file?
Can we have 2 web config files?
What are the different types of sessions in asp.net?
How long the items in ViewState exists?
What is the use of view state?