[thelist] Using @@Identity [BLOODY WELL SOLVED}]

Casey aspnet at thecrookstons.com
Wed Aug 24 21:31:18 CDT 2005


That's me cussing because I finaly got this solved, but it took me 30+
hours.  Is there anything wrong with doing it this oh-so-simple way, and not
using a stored procedure? Occam's Razor.  The simplest solution is usualy
the best.

Dim conAddDoc As SqlConnection = New

Dim strInsert As String = "Insert MCCIME_Doctor (fname, lname, specialty,
notes, ...) VALUES (@fname, @lname, @specality, ..) SELECT SCOPE_IDENTITY()"

 Dim cmdInsert As SqlCommand = NEW SqlCommand(strInsert, conAddDoc)

ViewState("NewDocId") = cmdInsert.ExecuteScalar()

Thanks to everyone who helped.

More information about the thelist mailing list