Sql Update

Hi Experts

When I use the following code
          CS.Open()
           cmdBuilder = New SqlCommandBuilder(DA)
            DA.Update(DS, "Codes")

It doesnot update untill the programe END
What I like to do is Update then fill the DS with new setting and carry on working without going out of the form
I tried the following
    'Update
           CS.Open()
           cmdBuilder = New SqlCommandBuilder(DA)
            DA.Update(DS, "Codes")
     'Fill DS
            DA.Fill(DS, "Codes")
            CS.Close()
            dt3 = DS.Tables("codes")
But it still have the old values. Unless I go out the form and debug again.
Please help
b001Asked:
Who is Participating?
 
CodeCruiserCommented:
Try disposing the Adapter and the dataset and recreate the objects.
0
 
regevhaCommented:
Try to add "DS.AcceptChanges()" after the "DA.Update(...)" line - http://msdn.microsoft.com/en-us/library/system.data.dataset.acceptchanges(v=vs.71).aspx 

It is not clear exactly what are your data processing requirements. Please attach a sample code (complete .NET project) and we will be able to assist you and provide you with modified code that solves the problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.