我在c#中有以下代碼,並且出現編譯錯誤。誰能幫幫我嗎?c#for循環錯誤代碼
更新
protected void Page_Load(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|OID.mdb;Persist Security Info=False;");
//OleDbConnection con = new OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle");
OleDbCommand cmd = new OleDbCommand();
//cmd.CommandText = "Select * from EMAILS WHERE EMAIL= '" + GlobalData.Email + "'";
cmd.CommandText = "Select * from EMAILS";
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
foreach (DataRow row in ds.Tables[0].Rows)
{
String email = row["email"].ToString();
if (email == GlobalData.Email)
{
Label2.Text = GlobalData.Email;
Label1.Text = GlobalData.Name;
Label3.Text = GlobalData.LastName;
}
else
{
Response.Redirect("login.aspx");
}
}
}
現在,它直接將其他部分的循環將是什麼錯誤,現在
什麼是錯誤? – 2011-12-31 11:08:03
這有編譯錯誤 – 2011-12-31 11:08:53
那麼編譯錯誤是什麼? – adt 2011-12-31 11:09:49