Click here to Skip to main content
15,881,881 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have design application

UserID TextBox1

SubmitButton


database as follows;

UserID Name Address
1 A Chennai
2 B Delhi
3 C Mumbai

in run mode in textbox1 when i type partiuclar userid and click the submit button the particular data to be displayed in the grid view.please send the code.help me.
Posted

1 solution

here I'm using SQL Database.. so make the connection as per this..

C#
string query="select * from table_name where UserID='"+userID+"'";
SqlDataAdapter da=new SqlDataAdapter(query, here your connection object or connection string);
DataTable dt=new DataTable();
da.Fill(dt);

DataGridView1.DataSource=dt;
DataGridView1.DataBind();     // optional
 
Share this answer
 

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