我希望我有另一个简单的问题要问那里的人。我目前在一个网站上工作,我有一个用户向服务器发布信息,发布后他们被带到一个验证页面,告诉他们它是否成功存储在 .mbd 表上。我对单个表执行此操作没有任何问题,但是当我想要验证存储在多个表上的信息时,我似乎遇到了问题。
这是我使用 THAT IS WORKING 发布到 SINGLE 表的代码
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.";
}
}
}
我想象我没有那么接近正确地做到这一点,但希望在球场上。
对此的任何帮助都会很棒。感谢您的时间