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 globalization and localization in asp net?
What are the ways to sending the data in ASP.NET page?
Why is asp.net so popular?
How is session id generated?
Explain the significance of routing? : asp.net mvc
What r the asp.net list controls and diff. Between them?
How can you register a custom server control to a web page?
What is server side session management?
How do I use a proxy server when invoking a web service?
Explain about asp.net 2.0 themes?
What is a session government?
What is difference between session and cookie?
What does postback mean?
What are the layouts of ASP.NET Pages?
To display data in a Repeater control which template you provide?