I am using Visual Studio 2010 for development.
This is a web application using asp.net and vb.net with MS SQL Server 2005 for the database.
I'm having some issues with inserted data being overwritten by the next transaction (if done within a relatively short amount of time, say, roughly several seconds).
I believe this may be related to how I'm exectuing the SQL in code. I have posted below an example of how I'm connecting. My concern is that this is not the correct way to do this. I am using a stored procedure to insert the data, but it does not seem to be the problem, because I have no issues when executing the commands simultaneously using SQL Managment Studio.
Is this an issue with all of the commands using the web.config file's connection string?
Is it an issue with the code I'm using to connect?
Thank You,
JTok
Sub InsertCheckOut()
Dim InsertQuery As String = "INSERT USING STORED PROCEDURE"
'Conn.ConnectionString points to the webconfig file's connection string
Using myConnection As New System.Data.SqlClient.SqlConnection(Conn.ConnectionString)
Using myCommand As New System.Data.SqlClient.SqlCommand(InsertQuery, myConnection)
Dim retvalue As Integer
myConnection.Open()
retvalue = myCommand.ExecuteNonQuery()
Console.WriteLine(retvalue)
End Using
End Using
End Sub