Problem updating MS SQL table

Hi I'm using some DevExpress components in C#, though I think the problem isn't in the DevExpress components. Using sqlConnection, sqlDataAdapter, dataSet, gridControl (a Datagrid) and controlNavigator (to choose insert record, edit record etc.).

When I make my program I can see all the data in the table appearing in the gridControl. Using the controlNavigator I can add records, delete them etc.

I use Microsoft SQL server 2000 (is there maybe a setting in MS SQL that prevents updating??).

I understand that my program loads a local copy of the database and at the end I have to let the program know that the real table in the server now needs to be updated.

I made a button under which I can test some commands. So I make some changes and than press this button.

I tried sqlDataAdapter1.Update(dataset11) and sqlDataAdapter1.Update(DataSet11,"films") (where films is the name of the table) also I tried dataSet11.acceptchanges().

No matter what I try each time when I quit the program and restart the program, my table is empty so no recors are added and the records I added and than changed are missing(PS only adding a record pressing the button and than quiting and restarting the program doesn't help).

Looking in some books I find an Commit statement, but this is used in conjunction with transactions, which I'm not using. The components like sqlDataAdapter do not have the commit command (or I cannot find it).

What do I need to do to effectivly change/update the real table??

I would like a solution where I can input/change data in the datagrid using the controlNavigator and then by adding somewhere some extra code make the changes permanent.

I hope someone can help

Kind regards,


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!