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
What do you know about ado.net's objects?
What is variable view?
What are the usages of the command object in ado.net?
What is ado and rdo?
Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?
Explain the advantages and disadvantages of using datalist?
How can we add relation between tables in a dataset?
What are the namespaces used in ADO.Net to connect to a database?
What is the difference between Command and CommandBuilder object?
What is an ado?
Explain the difference between an ado.net dataset and an ado recordset?
How do I delete a row from a DataTable?
Which architecture does Datasets follow?
Explain the basic use of "dataview" and explain its methods.
What is ole in excel?