R
RN1
When using the SqlCommand object, records can be inserted/updated/
deleted in the underlying data source (i.e. the SQL Server database
table) directly by using code like this:
--------------------------------------------------------------------------------
Dim strSQL As String
Dim sqlCmd As SqlCommand
Dim sqlConn As SqlConnection
strSQL = "INSERT INTO MyTable (Col1, Col2) VALUES........."
sqlConn = New SqlConnection("........")
sqlCmd = New SqlCommand(strSQL, sqlConn)
sqlConn.Open()
sqlCmd.ExecuteNonQuery()
sqlConn.Close()
--------------------------------------------------------------------------------
But if the SqlDataAdapter object is used to insert/update/delete
records in the data source, is it ALWAYS necessary to first make the
necessary changes in the DataSet for the data source to reflect the
changes?
deleted in the underlying data source (i.e. the SQL Server database
table) directly by using code like this:
--------------------------------------------------------------------------------
Dim strSQL As String
Dim sqlCmd As SqlCommand
Dim sqlConn As SqlConnection
strSQL = "INSERT INTO MyTable (Col1, Col2) VALUES........."
sqlConn = New SqlConnection("........")
sqlCmd = New SqlCommand(strSQL, sqlConn)
sqlConn.Open()
sqlCmd.ExecuteNonQuery()
sqlConn.Close()
--------------------------------------------------------------------------------
But if the SqlDataAdapter object is used to insert/update/delete
records in the data source, is it ALWAYS necessary to first make the
necessary changes in the DataSet for the data source to reflect the
changes?