Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.
Dim cn As New SqlConnection Dim cmd As New SqlCommand cn = GetConnected() cmd.Connection = cn cmd.CommandText = sSQL cmd.Parameters.Add(New SqlParameter("@FromDate", SqlDbType.DateTime)) ' etc - more parameters added ' This works - the record is added with a visible uniqueidentifier cmd.ExecuteNonQuery() ' This is where I'm trying to grab the Primary Key, but it returns a null.... cmd.Parameters.Clear() cmd.CommandText = "SELECT @@IDENTITY" Dim newID As String = "" & cmd.ExecuteScalar() ' ... so all of the record added here have a blank SessionID sSQL = "INSERT INTO tblScheduleStuff (Scheduler_SessionID, GenericStuff) SELECT '" & newID & "', Stuff FROM tblTEMPStuff" cmd.CommandText = sSQL cmd.ExecuteNonQuery()
|Is there a way to programmatically restart a VB.Net application when an exception occurs?||8||48|
|how can i make refactoring for below code for making faster?||4||29|
|conditional join based on column||4||8|
|Trouble analysing a database||9||0|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
24 Experts available now in Live!