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
Is asp.net a programming language?
Contrast OOP and SOA. What are tenets of each ?
What is caching in asp.net?
Why do we need asp.net?
What is the difference between a multi-layer and multi-tier applications?
A web service can only be written in .net? State whether true or false.
What is the request flow used for asp.net mvc framework? : asp.net mvc
How can we communicate with each server in N-tier Architecture? and what are the methods?
Define asp.net caching?
What is the life cycle of an asp.net page?
What is the page life cycle in asp.net?
Explain the main function of razor in asp.net? : asp.net mvc
What is the difference between web config and machine config files?
What is loop in asp.net?
What is the main differences between asp and asp.net?