主题:菜鸟求教:分析器错误
下面这段程序运行完后提示分析器错误,不知道是什么原因,请指点。
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace cha1
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList uidlist;
protected System.Web.UI.WebControls.TextBox txtname;
protected System.Web.UI.WebControls.TextBox txtadress;
protected System.Web.UI.WebControls.TextBox txtcontent;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
SqlConnection myConnection=new SqlConnection ("server=TY;uid=sa;pwd=sa;database=北风贸易;");
SqlCommand myCommand = new SqlCommand("SELECT 身份证号码,姓名,家庭住址,自传 FROM 飞狐工作室", MyConnection);
myConnection.Open();
SqlDataReader dr=myCommand.ExecuteReader();
bool firstrow=true;
while(firstrow)
{
txtname.Text=dr[1].ToString();
txtadress.Text=dr[2].ToString();
txtcontent.Text=dr[3].ToString();
firstrow=false;
}
}
dr.Close();
myConnection.Close();
}
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace cha1
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList uidlist;
protected System.Web.UI.WebControls.TextBox txtname;
protected System.Web.UI.WebControls.TextBox txtadress;
protected System.Web.UI.WebControls.TextBox txtcontent;
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
SqlConnection myConnection=new SqlConnection ("server=TY;uid=sa;pwd=sa;database=北风贸易;");
SqlCommand myCommand = new SqlCommand("SELECT 身份证号码,姓名,家庭住址,自传 FROM 飞狐工作室", MyConnection);
myConnection.Open();
SqlDataReader dr=myCommand.ExecuteReader();
bool firstrow=true;
while(firstrow)
{
txtname.Text=dr[1].ToString();
txtadress.Text=dr[2].ToString();
txtcontent.Text=dr[3].ToString();
firstrow=false;
}
}
dr.Close();
myConnection.Close();
}