I
id10t error
Hello,
I am making a scanner application. I am having a problem when the
users are using two scanners at one and they try to write to the TPS
file at the same time. Here is my code. Is there anything i am doing
wrong. If two people scan at the same time the scanners will freeze
up.
TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("DSNEMPMST")
TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("EMPMSTconnection")
'Opens the connection to get data from TPS file
TPSupdate.Open()
'Declares an object of OdbcCommand Object to execute the
select statement
Dim insertCmd As New Data.Odbc.OdbcCommand()
'Sets the propertirs of the command object
insertCmd.Connection = TPSupdate
insertCmd.CommandTimeout = 1000
'This will setup the record to be inserted into the table
insertCmd.CommandText = "Insert into RFPRD
(Numberscan,storenum,programid,usernumber,datescanned,timescanned)
Values ('" & numberscan & "','" & storenumber & "','" & programid &
"'," & userid & "," & todaynumber & "," & currenttime & ")"
'This is the command that will insert the record into
RFPRD.tps
insertCmd.ExecuteNonQuery()
insertCmd.Dispose()
TPSupdate.Close()
TPSupdate.Dispose()
I am making a scanner application. I am having a problem when the
users are using two scanners at one and they try to write to the TPS
file at the same time. Here is my code. Is there anything i am doing
wrong. If two people scan at the same time the scanners will freeze
up.
TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("DSNEMPMST")
TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("EMPMSTconnection")
'Opens the connection to get data from TPS file
TPSupdate.Open()
'Declares an object of OdbcCommand Object to execute the
select statement
Dim insertCmd As New Data.Odbc.OdbcCommand()
'Sets the propertirs of the command object
insertCmd.Connection = TPSupdate
insertCmd.CommandTimeout = 1000
'This will setup the record to be inserted into the table
insertCmd.CommandText = "Insert into RFPRD
(Numberscan,storenum,programid,usernumber,datescanned,timescanned)
Values ('" & numberscan & "','" & storenumber & "','" & programid &
"'," & userid & "," & todaynumber & "," & currenttime & ")"
'This is the command that will insert the record into
RFPRD.tps
insertCmd.ExecuteNonQuery()
insertCmd.Dispose()
TPSupdate.Close()
TPSupdate.Dispose()