using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class manage_EditOrdering : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
data UserLooking = new data();
UserLooking.UserLogin();
if (!IsPostBack)
{
ReaderOrdering();
//ReaderPro();
}
}
public string thisOrderingID; public void ReaderOrdering()
{
if (Request.QueryString["ID"] != "")
{
try
{
int Rqid = Convert.ToInt32(Request.QueryString["id"]);
data Reader = new data();
DataSet ds = Reader.ReturnDataSet("select ProID,ProColor,ProSize,ProDate,ProCount,ProContent,PeoType,PeoPeo,PeoPhone,PeoTel,PeoFax,PeoEmail,ProDate,State from ordering where 编号=" + Rqid + "");
thisOrderingID = ds.Tables[0].Rows[0][0].ToString();
Lbcolor.Text = ds.Tables[0].Rows[0][1].ToString();
Lbsize.Text = ds.Tables[0].Rows[0][2].ToString();
LbDate.Text = ds.Tables[0].Rows[0][3].ToString();
Lbcount.Text = ds.Tables[0].Rows[0][4].ToString();
Lbcenter.Text = ds.Tables[0].Rows[0][5].ToString();
Lbtype.Text = ds.Tables[0].Rows[0][6].ToString();
Lbpeo.Text = ds.Tables[0].Rows[0][7].ToString();
Lbphone.Text = ds.Tables[0].Rows[0][8].ToString();
Lbtel.Text = ds.Tables[0].Rows[0][9].ToString();
Lbfax.Text = ds.Tables[0].Rows[0][10].ToString();
Lbemail.Text = ds.Tables[0].Rows[0][11].ToString();
DropDownList1.SelectedValue = ds.Tables[0].Rows[0][13].ToString(); }
catch (Exception ex)
{
ex.ToString();
}
}
else
{
}
}
//public void ReaderPro()
//{
// data Read = new data();
// DataSet dsRead = Read.ReturnDataSet("selete name from Product where id=" + Convert.ToInt32(thisOrderingID) + "");
// Proname.Text = dsRead.Tables[0].Rows[0][0].ToString(); //} protected void sumbit_Click(object sender, EventArgs e)
{
data updateordering = new data();
updateordering.ExecuteSql("update ordering set State='" + DropDownList1.Text.ToString() + "' where 编号=" + Convert.ToInt32(Request.QueryString["id"]) + "");
}
}加上注释的代码就出问题.帮忙看看吧
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;public partial class manage_EditOrdering : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
data UserLooking = new data();
UserLooking.UserLogin();
if (!IsPostBack)
{
ReaderOrdering();
//ReaderPro();
}
}
public string thisOrderingID; public void ReaderOrdering()
{
if (Request.QueryString["ID"] != "")
{
try
{
int Rqid = Convert.ToInt32(Request.QueryString["id"]);
data Reader = new data();
DataSet ds = Reader.ReturnDataSet("select ProID,ProColor,ProSize,ProDate,ProCount,ProContent,PeoType,PeoPeo,PeoPhone,PeoTel,PeoFax,PeoEmail,ProDate,State from ordering where 编号=" + Rqid + "");
thisOrderingID = ds.Tables[0].Rows[0][0].ToString();
Lbcolor.Text = ds.Tables[0].Rows[0][1].ToString();
Lbsize.Text = ds.Tables[0].Rows[0][2].ToString();
LbDate.Text = ds.Tables[0].Rows[0][3].ToString();
Lbcount.Text = ds.Tables[0].Rows[0][4].ToString();
Lbcenter.Text = ds.Tables[0].Rows[0][5].ToString();
Lbtype.Text = ds.Tables[0].Rows[0][6].ToString();
Lbpeo.Text = ds.Tables[0].Rows[0][7].ToString();
Lbphone.Text = ds.Tables[0].Rows[0][8].ToString();
Lbtel.Text = ds.Tables[0].Rows[0][9].ToString();
Lbfax.Text = ds.Tables[0].Rows[0][10].ToString();
Lbemail.Text = ds.Tables[0].Rows[0][11].ToString();
DropDownList1.SelectedValue = ds.Tables[0].Rows[0][13].ToString(); }
catch (Exception ex)
{
ex.ToString();
}
}
else
{
}
}
//public void ReaderPro()
//{
// data Read = new data();
// DataSet dsRead = Read.ReturnDataSet("selete name from Product where id=" + Convert.ToInt32(thisOrderingID) + "");
// Proname.Text = dsRead.Tables[0].Rows[0][0].ToString(); //} protected void sumbit_Click(object sender, EventArgs e)
{
data updateordering = new data();
updateordering.ExecuteSql("update ordering set State='" + DropDownList1.Text.ToString() + "' where 编号=" + Convert.ToInt32(Request.QueryString["id"]) + "");
}
}加上注释的代码就出问题.帮忙看看吧
解决方案 »
- 用IIS5.1在XP下发布asp.net站点
- web.config里面的handlers
- WCF调用EF(Database First)出错。
- asp.net中对密码进行md5加密1
- 100分求关于ewebsoft控件的奇怪的问题!有结果马上结贴,在线等....
- 有没有办法修改dataGrid下的ButtonColumn的按钮样式
- XML的小问题!!
- 我在2000个人版下配置的IIS5.0,可在新建ASP。NET WEB 应用程序时页面上的控件一运行怎都不见了
- 一个xml的问题,请各位指教
- This sample demonstrates the page's LoadControl method, which is used to dynamically load a user control, passing the virtual pa
- 寻找Javascript+css+tabmenu代码一份
- sql的函数支持事务回滚吗??
这样声明是保存不了的,页面提交后这个class会重新实例化 thisOrderingID也会变为null这样声明 public string thisOrderingID
{
get
{
return ViewState["thisOrderingID"] != null ? (string)ViewState["thisOrderingID"] : string.Empty;
}
set
{
ViewState["thisOrderingID"] = value;
}
}