ADO.NET help, editing data in a database
-
Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code:
private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); }
Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciated -
Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code:
private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); }
Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciatedI've used ADO myself for sometime and have seen alot of errr.... Surperises you'd call them?!:-D Anyway, I'm sure the code is called, and that it's excuted without errors. From your code it looks like you've used the designer. Why didn't you use it to make the textboxes. It would update them automatically using a DataNavigator?
Regards:rose:
-
Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code:
private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); }
Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciated