The other is to include perhaps an out parameter which will be used by your T-SQL statement to set the current record ID back to this parameter...
lets give this a shot
'ok so you have just inserted your record. Still keep the connection open and lets execute a different command
Dim theReader as OleDbDataReader = theOleDbCommand.ExecuteReader(CommandBehavior.CloseConnection)
Dim lastId as Integer = -1
if theReader.HasRows = true then
theReader.Read()
lastId = Convert.ToInt32(theReader(0))
end if
'close connection
does this help
|