ziwez0
asked on
Search Results (Win Forms 2.0)
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:
a Sample:
string ConnectionString = "Data Source='db.sdf';";
SqlCeConnection connection = new SqlCeConnection(Connection
connection.Open();
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(SelectLas
DataSet ds = new DataSet();
da.Fill(ds, "Eaddress");
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!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Look up textbox databinding.