Suppose there is a DataTable t1 with fields f1, f2, f3 and it is necessary that the DataAdapter produce such an update on a real database:

UPDATE table1 SET p1=f1,p2=f2 WHERE p3=f3 

How do I configure the command object so that the DataAdapter does everything correctly?

The main snag in the parameters.

I understand correctly that I need to construct here with such a constructor

https://msdn.microsoft.com/ru-ru/library/cdd6yck6(v=vs.110).aspx ?

What is srcColumn? Is this a column in a DataTable or a real table?

    1 answer 1

    You can use this query on DataTableAdapter.UpdateCommand

     UPDATE table1 SET p1=@f1,p2=@f2 WHERE p3=@f3 
    • Well, in the same place you need to transfer SqlCommand => configure the parameters and all that, probably ... Or I am mistaken - iluxa1810
    • If you are using a visual DataSet, then you do not need to configure the parameters, if not, you can create a DataTableAdapter manually and use where you need it. DataTableAdapter itself understands with parameters. Create a DataTableAdapter manually - DataTableAdapter - ikram