B
Byron Hopp
Is there a similar way to append, delete, and update records via an object
in Ado.net similar to a Adodb.Recordset in Ado?
i.e. in ado I have done these tasks this way in Ado...
*** not tested Append ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where 1=0"
oRs.Open()
oRs.AddNew()
oRs.Fields("LastName").Value = "Hopp"
oRs.Fields("FirstName").Value = "Byron"
oRs.Update()
*** not tested Delete ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where LastName='Hopp'"
oRs.Open()
oRs.Delete()
oRs.Update()
*** not tested Update ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where LastName='Hopp'"
oRs.Open()
oRs.Fields("LastName").Value = "Hopp"
oRs.Fields("FirstName").Value = "B. L."
oRs.Update()
What would be a similar way of doing this in Ado.Net?
Thanks in advance.
Byron...
in Ado.net similar to a Adodb.Recordset in Ado?
i.e. in ado I have done these tasks this way in Ado...
*** not tested Append ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where 1=0"
oRs.Open()
oRs.AddNew()
oRs.Fields("LastName").Value = "Hopp"
oRs.Fields("FirstName").Value = "Byron"
oRs.Update()
*** not tested Delete ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where LastName='Hopp'"
oRs.Open()
oRs.Delete()
oRs.Update()
*** not tested Update ***
Dim oRs as new Adodb.Recordset
oRs:CursorLocation = adUseClient
oRs:LockType = adLockOptimistic
oRs:CursorType = adOpenDynamic
oRs.ActiveConnection = cConnStr
oRs.Source = "Select * from Names where LastName='Hopp'"
oRs.Open()
oRs.Fields("LastName").Value = "Hopp"
oRs.Fields("FirstName").Value = "B. L."
oRs.Update()
What would be a similar way of doing this in Ado.Net?
Thanks in advance.
Byron...