Enterprise Lib 3.1 updating data set problem

Topics: User Discussion
Jun 15, 2009 at 7:18 AM

Hi ,

Am using Enterprise lib 3.0 in vs 2005 .

I have initially loaded the data set using load data set method . Then i store the data to a new table from the dataset . I then make few chanages in the GUI  GRID that have reflected in the local table and in the dataset as well .

I dont have insert operations nor delete .I will only have update operations thru the sqlserver stored procedure .

Following is the update method which I give "nothing" for  Insert , delete commands , But the changes are not updated in the sqlserver data base .

DB.UpdateDataSet(VlvDataset, "Table1",Nothing, Updatecmd, Nothing, UpdateBehavior.Standard)

 

Please tell me is there any way to update the DB with out having insert command and delete command

 

Thanks

Devasena

 

 

 

Coordinator
Sep 5, 2009 at 8:19 PM

Hi Devasena,

EntLib ulitmately uses standard ADO.NET commands to persist your DataSet and thus will be using a data adapter. The dataAdapter.Update() method requires an Update, Insert, Delete and Select command set or it will not operate (I thought it actually gave an exception but perhaps not?).  When a DataSet is persisted to a DB The RowState is used by ADO.NET to determine what command to use, so although you might know that only Updates are required ADO.NET will complain if any commands are missing.  Having said that ADO.NET does not do any checking to see if the command is valid, so you would simply need to give it a dummy command.

Cheers...   Steve