from ADO to ADO.NET 2.0
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
Hi! The following code selects a row from a table. If the row exists then it is updated otherwise a new row is added to the table. How can I write this code using ADO.NET 2.0?
Dim rsRequest As New ADODB.Recordset rsRequest.Open "Select Form_No, User_ID, Status, Request_Date from tbl_ReExport_Info Where Form_No = '" & txtFormNo.Text & "' And User_ID = '" & txtUserID.Text & "'", cnnADO, adOpenDynamic, adLockOptimistic With rsRequest If .EOF = True Then .AddNew !Form_No = txtFormNo.Text !User_ID = txtUserID.Text !Status = 0 !Request_Date = Now .Update End With
Thank You Gulfraz Khan