Private Sub page_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As SqlConnection
Dim sqlconn As String
sqlconn = "server=localhost;uid=sa;pwd=sa;database=GuestBook"
Dim sqlstr As String
sqlstr = "select * from Guest_Book order bt ID desc"
conn = New SqlConnection(sqlconn)
conn.Open()
Dim cmd As SqlDataAdapter
cmd = New SqlDataAdapter(sqlstr, conn)
Dim ds As DataSet = New DataSet()
21 行 cmd.Fill(ds, "msg")
datamsg.DataSource = ds.Tables("msg").DefaultView
datamsg.DataBind()
conn.Close()
End Sub
第 1 行: 'bt' 附近有语法错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 第 1 行: 'bt' 附近有语法错误。
源错误:
行 19: cmd = New SqlDataAdapter(sqlstr, conn)
行 20: Dim ds As DataSet = New DataSet()
行 21: cmd.Fill(ds, "msg")
行 22: datamsg.DataSource = ds.Tables("msg").DefaultView
行 23: datamsg.DataBind()
源文件: F:\lixiaolong\留言本(NEW)\Default.aspx.vb 行: 21
快一个下午了,还没着落,所以只好向大家求救了,嘎嘎!
[此贴子已经被作者于2006-8-11 16:42:20编辑过]