using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Example04.Ex04_02
{
/// <summary>
/// ex04_04 的摘要说明。
/// </summary>
public class ex04_04 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblcommstr;
protected System.Web.UI.WebControls.Button btninsert;
protected System.Web.UI.WebControls.Button btndelete;
protected System.Web.UI.WebControls.Label lblflag;
protected SqlConnection myConn=new SqlConnection(); private void Page_Load(object sender, System.EventArgs e)

{
// 在此处放置用户代码以初始化页面
//设置myconnection 的属性
string strConn="server=Localhost;uid=sa;pwd=;database=Northwind";
myConn.ConnectionString=strConn;
}
       
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
public void CreateMyCommand(String myExecuteQuery,SqlConnection myConnection)
   {
    //创建数据命令,并执行
    SqlCommand myCommand = new SqlCommand(myExecuteQuery,myConnection);
    myCommand.Connection.Open();
    myCommand.ExecuteNonQuery();
    //显示数据命令的commandtext属性
    lblCommStr.Text="命令的CommandText 属性值为:"+myCommand.CommandText;
    myConnection.Close();
   }
}编译提示:c:\inetpub\wwwroot\example04\Ex04_02\ex04_04.aspx.cs(57): 应输入 class、delegate、enum、interface 或 struct但是加CLASS后,又会出现更多的错误提示,达人解释一下!!!