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?
What is connection pooling and what is the maximum pool size in ado.net connection string?
What are dataproviders?
What is the difference between sqldatareader and sqldataadapter?
What is the difference between an ADO.NET Dataset and an ADO Recordset?
What is difference between executenonquery and executequery?
What is the difference between data grid and data repeater?
What is the default Timeout for SqlCommand.CommandTimeout property?
What is a datagridview?
What are the rules to implement connection pooling?
What are the ado.net components?
What are the namespaces used in ADO.Net to connect to a database?
What are the different row versions available in table?
Explain ODP.net
Which object holds only data and does not interact with data source?