代码如下:    
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not IsPostBack Then
            Dim sqlstr As String = "SELECT id, title, content FROM page WHERE (pagecode = 1)"
            Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Documents and Settings\App_Data\page.mdb"
            Dim objcon As New OleDbConnection(connstr)
            Dim objdataset As New DataSet()
            Dim objajapter As New OleDbDataAdapter(sqlstr, objcon)             Try
                objajapter.Fill(objdataset, "code")
                Dim objDataView As New DataView(objdataset.Tables("code"))
                Datal.DataSource = objDataView
                Datal.DataBind()
            Catch objError As OleDbException
                If Left(objError.Message, 21) = "Login failed for user" Then
                    ddc.Text = "Problem with Log-in"
                ElseIf Left(objError.Message, 19) = "Could not find file" Then
                    ddc.Text = "We could not find the MDB file that you asked for"
                Else
                    ddc.Text = "<br />message - " & objError.Message
                    ddc.Text += "<br />source - " & objError.Source
                End If
            End Try       
        End If
    End Sub
没有显示错误,也没有显示数据,sql返回的记录有很多条的。各位大哥帮忙看下。

解决方案 »

  1.   

    补充一下 SQL语句有毛病,把sql再怎么改都没反应
    如:SELECT  * FROM  page 都没反应
      

  2.   

    objdataset.Tables("code"))把这里改为objdataset.Table["code"]试试看!
      

  3.   

    VB的看的头晕
    你的objcon 有没有 Open啊?
      

  4.   

    亲爱的同志们,我遇到了一个以前有人也遇到的问题,可没有人解决。
    后台编码,数据无法显示。
    http://topic.csdn.net/t/20030513/15/1777619.html
      

  5.   

    自己回答:
       前台没写<itemcolumn> 以为和datagrid一样了