看看你的变量声明代码里面有DataSet1吗?

解决方案 »

  1.   

    或者看看你的DataSet控件的名称应该是什么,向导生成的数据集默认为dataSet11
      

  2.   

    已经定义了呀,这样对吗
       Protected WithEvents DataSet1 As WebApplication1.DataSet1
      

  3.   

    在webform1.aspx.vb中是这样定义的Public Class WebForm1
        Inherits System.Web.UI.Page
        Protected WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
        Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
        Protected WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
        Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
        Protected WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
        Protected WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
        Protected WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
        Public WithEvents DataSet1 As WebApplication1.DataSet1
        Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
      

  4.   

    编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: BC30451: 名称“DataSet1”未声明。源错误: 行 13:  <body MS_POSITIONING="GridLayout">
    行 14:  <form id="Form1" method="post" runat="server">
    行 15:  <asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server" DataSource="<%# DataSet1 %>" DataMember="Courseware" DataKeyField="CWID" AllowCustomPaging="True" AllowPaging="True" AllowSorting="True" ShowFooter="True">
    行 16:  <HeaderStyle ForeColor="Blue"></HeaderStyle>
    行 17:  <Columns>