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 is shadow copy?
How to create data relations?
What is a data control clerk?
Describe briefly an ADO.NET Dataset ?
What is DataRowCollection?
How is entity framework different from ado.net?
What are the various methods provided by the DataSet object to generate XML?
What is the difference between a datareader and a dataset?
What are the essential features of ado.net?
Which method is used by command class to execute SQL statements that return single value?
how we can fire event in databound coulm in datagfrid withot using button?
Which object is used to add relationship between two Datatables?
What are the ado.net connection pooling parameters?
What is isolation?
What is namespace in ado.net?