Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used a textbox in a page.
if i want to check the typed word with the one in the database, i have to check the condition,
textbox1.text=='that database field' and then display the other db field using datalist control. i want to know how to mention 'that database field' to check the condition or else is there any other possibilities?
help me pls..
Posted
Comments
Herman<T>.Instance 1-Aug-11 4:28am    
what have you tried?
read anything about ADO.NET?
What kinda DB server do you use?

1 solution

protected void textbox1_TextChanged(object sender, EventArgs e)
{
    Connection cn = new Connection();
    string strSql = "select  * from [Table]";
    DataTable ds = new DataTable();
    ds = cn.GetDatanew(strSql);
    if (textbox1.Text == ds.Rows[0]["id"].ToString())
    {

    }
}
 
Share this answer
 
v2
Comments
_Zorro_ 1-Aug-11 6:00am    
Come on...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900