R
Rabbit
Dear all,
After updating the changes in dataset onto database thru the dataAdapter, if
the UpdateCmd of the dataAdapter is based on parameters store proc which
return a field called "LastUpdatedDate". Can it be updated onto the dataset?
=========== part of my code as follows ===========
Dim SelectCmd As New SqlCommand(SP_CUSTOMER_GET_ALL, conn)
SelectCmd.CommandType = CommandType.StoredProcedure
Dim UpdateCmd As New SqlCommand(SP_CUSTOMER_UPDATE, conn)
UpdateCmd.CommandType = CommandType.StoredProcedure
With UpdateCmd.Parameters
.Add("@LastUpdatedDate", SqlDbType.DateTime).Direction =
ParameterDirection.Output
.Add("@CustomerID", SqlDbType.Char, 7, "CustomerID")
.Add("@Name", SqlDbType.NVarChar, 15, "Name")
End With
da = New SqlDataAdapter
da.SelectCommand = SelectCmd
da.UpdateCommand = UpdateCmd
Dim ds As New DataSet
da.Fill(ds, "tbl_Customer")
=================================
Is there a way to return those output information back to dataset thru the
dataAdapter on the Update process? so that it can save one more trip to
requery the database to reflect the changes.
Thanks in advance!
After updating the changes in dataset onto database thru the dataAdapter, if
the UpdateCmd of the dataAdapter is based on parameters store proc which
return a field called "LastUpdatedDate". Can it be updated onto the dataset?
=========== part of my code as follows ===========
Dim SelectCmd As New SqlCommand(SP_CUSTOMER_GET_ALL, conn)
SelectCmd.CommandType = CommandType.StoredProcedure
Dim UpdateCmd As New SqlCommand(SP_CUSTOMER_UPDATE, conn)
UpdateCmd.CommandType = CommandType.StoredProcedure
With UpdateCmd.Parameters
.Add("@LastUpdatedDate", SqlDbType.DateTime).Direction =
ParameterDirection.Output
.Add("@CustomerID", SqlDbType.Char, 7, "CustomerID")
.Add("@Name", SqlDbType.NVarChar, 15, "Name")
End With
da = New SqlDataAdapter
da.SelectCommand = SelectCmd
da.UpdateCommand = UpdateCmd
Dim ds As New DataSet
da.Fill(ds, "tbl_Customer")
=================================
Is there a way to return those output information back to dataset thru the
dataAdapter on the Update process? so that it can save one more trip to
requery the database to reflect the changes.
Thanks in advance!