V
Vijay Balki
This might be a dumb question to ask. Can someone answer me with patience..
When I have a typed or un-typed dataset, the only way I can update is like
below?
Dim con As New SqlConnection(ConnectionString)
con.Open()
Dim daProductsDS As New SqlDataAdapter("Select * from ProductsDS", con)
Dim oCommandBuilder As New SqlCommandBuilder(daProductsDS)
daProductsDS.DeleteCommand = oCommandBuilder.GetDeleteCommand
daProductsDS.InsertCommand = oCommandBuilder.GetInsertCommand
daProductsDS.UpdateCommand = oCommandBuilder.GetUpdateCommand
'Apply the updates
daProductsDS.Update(dsNorthwind, "ProductsDS")
Why do I have to delete and insert? Is the old fashion way of just updating
dead in DOT.NET? Please help me understand this. Why was this done away with
in dataset ? The other way is to manually use SQL statements to do
inserts/updates. But again I lose the power of using datasets.
Vijay
When I have a typed or un-typed dataset, the only way I can update is like
below?
Dim con As New SqlConnection(ConnectionString)
con.Open()
Dim daProductsDS As New SqlDataAdapter("Select * from ProductsDS", con)
Dim oCommandBuilder As New SqlCommandBuilder(daProductsDS)
daProductsDS.DeleteCommand = oCommandBuilder.GetDeleteCommand
daProductsDS.InsertCommand = oCommandBuilder.GetInsertCommand
daProductsDS.UpdateCommand = oCommandBuilder.GetUpdateCommand
'Apply the updates
daProductsDS.Update(dsNorthwind, "ProductsDS")
Why do I have to delete and insert? Is the old fashion way of just updating
dead in DOT.NET? Please help me understand this. Why was this done away with
in dataset ? The other way is to manually use SQL statements to do
inserts/updates. But again I lose the power of using datasets.
Vijay