ADO to ADO.NET - Retrieve the AutoIncrement or Identity value of a column
From: Loren Dummer (ldummer_at_isaconsultants.com)
Date: 06/08/04
- Next message: ASP.Confused: "Re: Memory leak in ASP.NET web site"
- Previous message: Jon Davis: "Memory leak in ASP.NET web site"
- Next in thread: William Ryan eMVP: "Re: ADO to ADO.NET - Retrieve the AutoIncrement or Identity value of a column"
- Reply: William Ryan eMVP: "Re: ADO to ADO.NET - Retrieve the AutoIncrement or Identity value of a column"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Jun 2004 15:26:57 -0500
Hello All,
I am converting a VB6 application to .Net and having problems converting the
following code.
VB6 Code:
Dim lDataID as Long
sSql = "SELECT * " & _
"FROM MSMQData"
Set adoRs = New ADODB.Recordset
With adoRs
.Open sSql, adoCn, adOpenKeyset, adLockOptimistic, adCmdText
.AddNew
!XMLData = objDOM.xml
.Update
lDataID = !DataID
.Close
End With
Set adoRs = Nothing
I can get this to work using a SQLCommand object and pass back the
@@Identity value in an Output parameter with the stored procedure.
I cannot figure out what I should be using to convert this correctly.
Any help is appreciated.
- Next message: ASP.Confused: "Re: Memory leak in ASP.NET web site"
- Previous message: Jon Davis: "Memory leak in ASP.NET web site"
- Next in thread: William Ryan eMVP: "Re: ADO to ADO.NET - Retrieve the AutoIncrement or Identity value of a column"
- Reply: William Ryan eMVP: "Re: ADO to ADO.NET - Retrieve the AutoIncrement or Identity value of a column"
- Messages sorted by: [ date ] [ thread ]