Im building a Search facility and want to return a set of results (Done!)
The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes:
string ConnectionString = "Data Source='db.sdf';";
SqlCeConnection connection = new SqlCeConnection(ConnectionString);
string strLastName = textBox1.Text;
string strPostCode = textBox2.Text;
string strEmail = textBox3.Text;
if (!(textBox1.Text == null))
string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'";
SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString);
DataSet ds = new DataSet();
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Eaddress";
i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2.
example would help very much!!