Incorrect syntax near '4'

后端 未结 4 1541
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 00:51

I have an INSERT code where the variable s = 4. Help would be pretty appreciated.

 con.Open()
            Dim cmd As New SqlCommand(\"INSERT INTO Employee VALUES         


        
4条回答
  •  忘掉有多难
    2021-01-29 01:33

    Misssing closing bracket )

    con.Open()
                Dim cmd As New SqlCommand("INSERT INTO Employee VALUES('" & txtfname.Text & "','" & txtmi.Text & "','" & txtlname.Text & "','" & txtssn.Text & "','" & txtbdate.Text & "','" & txtaddress.Text & "','" & cmbsex.Text.ToUpper & "','" & txtsalary.Text & "','" & DBNull.Value & "','" & s & "')", con)
    

提交回复
热议问题