重载决策失败,原因是没有可访问的"fill"可以用这些参数调用
Private connectionstring As String = "provider=sqloledb.1; data source=localhost; initial catalog=pubs; integrated security=sspi "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Me.IsPostBack = False Then
createlist()
End If
End Sub
Private Sub createlist()
Dim selectsql As String
selectsql = "select au_lname,au_fname,au_id from authors "
Dim con As New OleDbConnection(connectionstring)
Dim cmd As New OleDbCommand(selectsql, con)
Dim adapter As New OleDbDataAdapter(cmd)
Dim dspubs As New DataSet
Try
con.Open()
adapter.Fill(dspubs, "authors ") '这里错了!!!!!!
cmd.CommandText = "select au_id,title_id from titleauthor "
adapter.Fill(dspubs, "titleauthor ") '还有这里!!!!!!
cmd.CommandText = "select title_id,title from titles "
adapter.Fill(dspubs, "titles ") '问题都一样!!!!!!
Catch err As Exception
lbllist.text = "error reading list of names. "
lbllist.text &= err.Message
Finally
If (Not con Is Nothing) Then
con.Close()
End If
End Try
End Sub
高手帮忙看下,哪里写错了啊!!
谢谢了!!
[解决办法]
把try-catch去掉,然后把页面上的错误提示完整贴出来吧.
不建议Web程序还在调试阶段(显然你现在还在调试..)就加个try-catch.