我希望我有另一個人在那裏的簡單問題。 即時通訊工作在一個網站,我有一個用戶發佈信息到服務器和張貼後,他們被帶到驗證頁面,告訴他們,如果它成功存儲在.mbd表或不。對於單個表,我沒有這樣做的問題,但是當我想要驗證存儲在多個表上的信息時,我似乎遇到了一個問題。驗證,如果記錄帖子到多個表
該處是即時通訊使用該代碼是工作張貼到單個表
protected void Page_Load(object sender, EventArgs e)
{
txtVerifiedInfo.Text = Session["txtUserFirstName"].ToString() +
"\n" + Session["txtUserLastName"].ToString() +
"\n" + Session["txtUserName"].ToString() +
"\n" + Session["txtUserPassword"].ToString() +
;
// Check if the record is successfully saved in the tblUserLogin Table and prints the appropriate message in the text box txtVerifiedInfo
if (clsDataLayer.SavePersonnel(Server.MapPath("App_Data\\WSC_DB.mdb"),
Session["txtUserFirstName"].ToString(),
Session["txtUserLastName"].ToString(),
Session["txtUserName"].ToString(),
Session["txtUserPassword"].ToString(),
))
{
txtVerifiedInfo.Text = txtVerifiedInfo.Text +
"\nThe information was successfully saved!";
}
else
{
txtVerifiedInfo.Text = txtVerifiedInfo.Text +
"\nThe information was NOT saved.";
}
}
}
以下是我已經嘗試沒有太大的運氣在所有
if (clsDataLayer.Saveneworder(Server.MapPath("App_Data\\WSC_DB.mdb"),
Session["txtfirstName"].ToString(),
Session["txtlastName"].ToString(),
Session["txtstreetAddress"].ToString(),
Session["txtcity"].ToString(),
Session["txtzipCode"].ToString()))
&& if (clsDataLayer.Savenewitem(Server.MapPath("App_Data\\WSC_DB.mdb"),
Session["jobType"].ToString() +
Session["txtmediaContent"].ToString()))
{
txtVerifiedInfo.Text = txtVerifiedInfo.Text +
"\nThe Order successfully submitted!";
}
else
{
txtVerifiedInfo.Text = txtVerifiedInfo.Text +
"\n The order did not save, please return to the previous screen and verify all of yourr data is correct, thank you.";
}
}
}
我想我不是那接近正確,但希望這樣做球公園。
任何幫助,這將是偉大的。 感謝您的時間
表達式'if(condition)&& if(condition2)'沒有意義。它應該是'if(condition && condition2)'。我不是100%肯定這是唯一的問題,雖然.. –
謝謝 - 我會嘗試移動。如果對每個表有不同的會話並嘗試在同一個if語句下列出所有的會話,那麼對於我來說這是不合理的部分。 –