Link to home
Start Free TrialLog in
Avatar of ziwez0
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(ConnectionString);
            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(SelectLastName, ConnectionString);
                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
Avatar of topdog770
topdog770
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of flashaoy
flashaoy

Look up textbox databinding.