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
How to reduce the width of textbox in editcommandcolumn of datagrid?
Why do we use datasource in asp.net?
Is there any alternative to avoid name collisions other then Namespaces?
What is the Difference between MVC And MVP design pattrens
How to you can limit Access to Web API to Specific HTTP Verb?
What is the life cycle of web page?
Where is the view state data stored?
Hi All, Im an MCA holder with 3+ years of experience in asp.net. Now i want to move to some good government job. I have no idea about different categories of exams held & which one can be applicable for my education background. I have done B.A with MCA. Please help me out with your valuable suggestions. I would be very grateful. Thanks Anuj
Explain what are the advantages of asp.net mvc framework? : asp.net mvc
Define static constructor?
What are the main differences between asp and asp.net?
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?
List the events in page life cycle.
What is a web api endpoint?
Explain how can you debug your .net application?