i have two textboxes one for user name and another for
password . i have a table name compare(which contains
name,passwod etc.,)my doubt is how compare username
textbox with name column and how compare password textbox
with passwod column. i want the code
Answer Posted / boopathiraj
sqlconnection con = new sqlconnection("");
sqlcommand cmd = new sqlcommand("select * from
table-name",con);
//write this code in the button click event
con.open();
dr = cmd.executereader();
while(dr.read())
{
if(textbox1.text==dr.getvalue(0).tostring()&&
textbox2.text==dr.getvalue(1).tostring())
{
msgbox.show("successful");
}
}
con.close();
else
{
msgbox.show("not success");
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Data reader read and forward only, how is it possible to get 2 tables of data at a time?
What are the main differences between classic ado and ado.net?
What is an ado connection?
How do you update a dataset in ado.net?
How to add an aggregate column?
What is ado and rdo?
Explain the architecture of ado.net?
What is ado control?
What is the difference between Command and CommandBuilder object?
How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
How to identify the controls which can be used for binding data?
Explain ODP.net
What is the use of Dataview?
What is the difference between a datareader and a dataset?
What is the current version of entity framework?