file附近有语法错误??
Dim cmd As SqlCommand
myconn = New SqlConnection("server=localhost;database=database;uid=sa;pwd=sa")
Dim sqlstr As String = ""
sqlstr = "insert into file(score) values('" + TextBox2.Text + " ')"
myconn.Open()
cmd = New SqlCommand(sqlstr, myconn)
cmd.ExecuteNonQuery()
cmd.Dispose()
myconn.Close()
sqlstr = ""
Response.Write("<script>alert('添加成功!');location.href='teacher5.aspx';</script>")
------解决方案--------------------[file] 试试
------解决方案--------------------sql关键字加 []
sqlstr = "insert into [file](score) values('" + TextBox2.Text + " ')"
------解决方案--------------------SQL code
insert into [File](score) values('ss')
------解决方案--------------------
SQL code
INSERT INTO [file]([score])VALUES('123')