急问!!!vb中使用存储过程总是出现必须声明标量变量 "@ticketnum"。
Dimx,wAsStringDimy,z,nAsIntegerx=Trim(txt2.Text)w=Trim(txt4.Text)y=CInt(txt1.Text)z=C...
Dim x, w As String
Dim y, z, n As Integer
x = Trim(txt2.Text)
w = Trim(txt4.Text)
y = CInt(txt1.Text)
z = CInt(txt3.Text)
n = Val(txtNo.Text)
myCom3.Connection = myCon
myCom3.CommandText = "INSERT INTO 购票(filmid, cinemaid,showid,hallid,ticketnum)values(@filmid, @cinemaid,@showid,@hallid,@ticketnum)"
myCom3.Parameters.AddWithValue("@filmid", "x")
myCom3.Parameters.AddWithValue("@cinemaid", y)
myCom3.Parameters.AddWithValue("@showid", z)
myCom3.Parameters.AddWithValue("@hallid", "w")
myCom3.Parameters.AddWithValue("@ticketnumd", n)
myCom3.ExecuteNonQuery()
MsgBox("订票成功!", "提示") 展开
Dim y, z, n As Integer
x = Trim(txt2.Text)
w = Trim(txt4.Text)
y = CInt(txt1.Text)
z = CInt(txt3.Text)
n = Val(txtNo.Text)
myCom3.Connection = myCon
myCom3.CommandText = "INSERT INTO 购票(filmid, cinemaid,showid,hallid,ticketnum)values(@filmid, @cinemaid,@showid,@hallid,@ticketnum)"
myCom3.Parameters.AddWithValue("@filmid", "x")
myCom3.Parameters.AddWithValue("@cinemaid", y)
myCom3.Parameters.AddWithValue("@showid", z)
myCom3.Parameters.AddWithValue("@hallid", "w")
myCom3.Parameters.AddWithValue("@ticketnumd", n)
myCom3.ExecuteNonQuery()
MsgBox("订票成功!", "提示") 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询