Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating an SQL database issue.

Status
Not open for further replies.

HighlandJinx

Programmer
May 20, 2002
34
GB
Creating a small app in Visual Studio using Visual c#.

I have an SQLExpress Database, and have a datagrid reading the data. But once the user edits a row and updates using the save button, the program DOES say that its been updated,and does show it on the grid, but once i exit the program, the data has not been written the the database. Here is the code for the save:
Code:
        private void lkuEquipmentInfoBindingNavigatorSaveItem_Click_1(object sender, EventArgs e)
        {
            this.Validate();
            this.lkuEquipmentInfoBindingSource.EndEdit();
            int results = 0;
            results = this.lkuEquipmentInfoTableAdapter.Update(this.wFRPDataDataSet.lkuEquipmentInfo);
            MessageBox.Show("Rows Updated = " + results.ToString());
        }

The User edits the grid with thats bound to the lkuEquipmentInfoBindingSource.
They hit Save and this is what happens, and a message box appears saying how many Rows have been updated. It always does return the correct number of rows, but it doesnt ACTUALLY save it to the database.

Any help would be great,

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top