[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
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("MccCon
String"))

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)

conAddDoc.Open
ViewState("NewDocId") = cmdInsert.ExecuteScalar()
conAddDoc.Close

Thanks to everyone who helped.



More information about the thelist mailing list