Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 23-Nov-12 6:10am
(unknown member)

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

here I'm using SQL Database.. so make the connection as per this..
 
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
  Permalink  

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

  Print Answers RSS
0 DamithSL 495
1 Maciej Los 258
2 OriginalGriff 229
3 BillWoodruff 170
4 Zoltán Zörgő 165
0 OriginalGriff 7,934
1 DamithSL 6,084
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,174
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100