Copy data from one column to another [Resolved]
Hi,
I am trying to copy data from one column into another using a dataset binded to a datagrid. (NewPrice is a computed column, new_price column is in the sql table.)
.net does not let you save computed columns, so i need to copy the data from the computed column to the actual column.
The program runs without any errors but nothing at all is committed to the database (SQL 2000).
Here is the code in my update button:
Can any one help?
thanks
Hi,
I am trying to copy data from one column into another using a dataset binded to a datagrid. (NewPrice is a computed column, new_price column is in the sql table.)
.net does not let you save computed columns, so i need to copy the data from the computed column to the actual column.
The program runs without any errors but nothing at all is committed to the database (SQL 2000).
Here is the code in my update button:
VB.NET:
Dim command_builder As New SqlCommandBuilder(daAdaptor)
Dim dr As DataRow
Dim dt As DataTable = ds.Tables("Price_List")
For Each dr In dt.GetChanges.Rows[indent]dr("new_price") = dr("NewPrice")
[/indent]Next
dataAdaptor.Update(ds, "Price_List")
Can any one help?
thanks
Last edited: