Manesti
Member
- Joined
- Jan 16, 2009
- Messages
- 16
- Programming Experience
- Beginner
I have this code in my page, but I really dont know why I get this error " Incorrect, sysntax error near "o". pkease I need assistance please. thank you
Dim sql As String = "INSERT INTO Offence (offenceCode,route,location,offenceTime,0ffenderID)" _
& " VALUES(@offenceCode,@route,@location,@offenceTime,@offenderID)"
cmd = New SqlCommand(sql, con)
cmd.Parameters.Add("@offenceCode", SqlDbType.VarChar, 50).Value = Code
cmd.Parameters.Add("@route", SqlDbType.VarChar, 50).Value = route
cmd.Parameters.Add("@location", SqlDbType.VarChar, 3).Value = location
cmd.Parameters.Add("@offenceDate", SqlDbType.DateTime, 15).Value = offenceDate
cmd.Parameters.Add("@offenceTime", SqlDbType.VarChar, 50).Value = Time
cmd.Parameters.Add("@offenderID", SqlDbType.Int, 10).Value = ID
' Try
con.Open()
cmd.ExecuteNonQuery()
'Catch ex As Exception
'MsgBox(ex.Message)
'End Try
con.Close()
cmd = Nothing
Dim sql As String = "INSERT INTO Offence (offenceCode,route,location,offenceTime,0ffenderID)" _
& " VALUES(@offenceCode,@route,@location,@offenceTime,@offenderID)"
cmd = New SqlCommand(sql, con)
cmd.Parameters.Add("@offenceCode", SqlDbType.VarChar, 50).Value = Code
cmd.Parameters.Add("@route", SqlDbType.VarChar, 50).Value = route
cmd.Parameters.Add("@location", SqlDbType.VarChar, 3).Value = location
cmd.Parameters.Add("@offenceDate", SqlDbType.DateTime, 15).Value = offenceDate
cmd.Parameters.Add("@offenceTime", SqlDbType.VarChar, 50).Value = Time
cmd.Parameters.Add("@offenderID", SqlDbType.Int, 10).Value = ID
' Try
con.Open()
cmd.ExecuteNonQuery()
'Catch ex As Exception
'MsgBox(ex.Message)
'End Try
con.Close()
cmd = Nothing