主题:新手求教:帮我看一下哪里有问题.
private void Page_Load(Object sender,System.EventArgs e)
{
String str="server=tianyu; uid=sa; pwd=sa; Database=北风贸易;"
SqlConnection objConnection=new SqlConnection(str);
String strSQL="SELECT 身份证号码,姓名,家庭住址,自转 FROM 飞狐工作室";
SqlCommand objCommand=new SqlCommand(strSQL,objConnection);
objConnection.Open();
SqlDataReader dr=objCommand.ExecuteReader();
bool Firstrow=true;
while(dr.read())
{
uidlist.Items.Add(new ListItem(dr[0].ToString()));
if(Firstrow)
{
txtname.Text=dr[1].ToString();
txtadress.Text=dr[2].ToString();
txtContent.Text=dr[3].ToString();
Firstrow=flase;
}
}
dr.Close();
objConnection.Close();
}
}
显示错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1518: Expected class, delegate, enum, interface, or struct
Source Error:
Line 110: #line hidden
Line 111:
Line 112: public chaxun_aspx() {
Line 113: System.Collections.ArrayList dependencies;
Line 114:
是不是不支持汉语??
{
String str="server=tianyu; uid=sa; pwd=sa; Database=北风贸易;"
SqlConnection objConnection=new SqlConnection(str);
String strSQL="SELECT 身份证号码,姓名,家庭住址,自转 FROM 飞狐工作室";
SqlCommand objCommand=new SqlCommand(strSQL,objConnection);
objConnection.Open();
SqlDataReader dr=objCommand.ExecuteReader();
bool Firstrow=true;
while(dr.read())
{
uidlist.Items.Add(new ListItem(dr[0].ToString()));
if(Firstrow)
{
txtname.Text=dr[1].ToString();
txtadress.Text=dr[2].ToString();
txtContent.Text=dr[3].ToString();
Firstrow=flase;
}
}
dr.Close();
objConnection.Close();
}
}
显示错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1518: Expected class, delegate, enum, interface, or struct
Source Error:
Line 110: #line hidden
Line 111:
Line 112: public chaxun_aspx() {
Line 113: System.Collections.ArrayList dependencies;
Line 114:
是不是不支持汉语??