hey friends i need a help urgently....
i'm doing a project where i use listbox...i'm facing problem with this
firstly i'm populating a listbox with particular field...then on clicking particular item in listbox the corresponding records from database should get displayed in all the textboxes of the form...here's a sample code which i treid but there's problem.....
after modifying or deleting particular record the first item record doesnot get displayed in textbox....plzzzz sought out my problem....

private void Form1_Load(object sender, System.EventArgs e) {
         string connString = "server=(local)\\SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI";
         string sql = @"select firstname, lastname from employee ";

         SqlConnection conn = new SqlConnection(connString);
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dataSet1, "employee");
         DataTable dt = dataSet1.Tables["employee"];

         listBox1.DataSource = dt;
         listBox1.DisplayMember = "firstname";

         textBox1.DataBindings.Add("text", dt, "firstname");

         textBox2.DataBindings.Add("text", dt, "lastname");


i'm using vb.net 2003 and ms access but code is foe sql which i can convert it to oledb later....

8 Years
Discussion Span
Last Post by Ezzaral

First of all it's VB.NET forum you should put your question on C# forum.
Get us the code which you delete\update records by.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.