Unanswered: Trying to insert row (autogenerate key) failing
I am trying to insert a row into a sql table; I set the identity to 'yes' and seed to 1, increment to 1 in sql manager.
My webpage does the insert but I am receiving this error. Any help would be great. Thanks in advance!
Dim mySQL As String = "Insert into Process_Master (ProcessName) values (@pname)"
Dim myConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("M ATRIX_CONNECTION_STRING"))
I thought that you are suppose to turn the Identity_insert to 'on' when you want to specify your own id number or 'off' to let the system generate it automatically? Is there a way so that I could set it to 'on' at the same time I send my 'insert' statement? Thanks.
Yes, processid,processname; I wanted to just do an insert with the processid automatically increment to the current max number +1. I don't see why there would be a problem if I just insert with a new processname row; my sql table is set properly also to identity_insert(1,1); I had existing rows in the table then set the identity_insert; I wonder if this is part of my problem?