c#c# and girl doing
private object rec_disp(int show)
{
if((Convert.ToInt32(show))==1)
{
this.lbl_mess.Visible =false;
this.Panel1.Visible=true;
this.txt_Customerid.Text=Session["ds1"].Tables["Customers"].Rows[Session["Position"]].Items["Customerid"].ToString();
this.txt_Companyname.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Companyname"].ToString();
this.txt_Phone.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Phone"].ToString();
this.txt_Fax.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Fax"].ToString();
this.txt_Address.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Address"].ToString();
this.txt_Country99.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Country99"].ToString();
}
else
{
this.lbl_mess.Visible=true;
this.Panel1.Visible=false;
this.txt_Customerid.Text="";
this.txt_Companyname.Text="";
this.txt_Phone.Text="";
this.txt_Fax.Text="";
this.txt_Address.Text="";
this.txt_Country99.Text="";
}
}
此句有问题:C:\Inetpub\wwwroot\WebApplication1\WebForm1.aspx.cs(71): “object”并不包含对“Tables”的定义
this.txt_Companyname.Text=Session["ds1"].Tables["Customers"].Rows(Session["Position"]).Items["Companyname"].ToString();
请问怎么改啊?
问题点数:20、回复次数:1Top
1 楼singlepine(小山)回复于 2006-03-14 00:22:02 得分 20
private void rec_disp(int show)
{
DataSet ds=(DataSet)Session["ds1"];
int i=Convert.ToInt32(Session["Position"]);
if((Convert.ToInt32(show))==1)
{
this.lbl_mess.Visible =false;
this.Panel1.Visible=true;
this.txt_Customerid.Text=ds.Tables["Customers"].Rows[i]["Customerid"].ToString();
this.txt_Companyname.Text=ds.Tables["Customers"].Rows[i]["Companyname"].ToString();
this.txt_Phone.Text=ds.Tables["Customers"].Rows[i]["Phone"].ToString();
this.txt_Fax.Text=ds.Tables["Customers"].Rows[i]["Fax"].ToString();
this.txt_Address.Text=ds.Tables["Customers"].Rows[i]["Address"].ToString();
this.txt_Country99.Text=ds.Tables["Customers"].Rows[i]["Country99"].ToString();
}
else
{
this.lbl_mess.Visible=true;
this.Panel1.Visible=false;
this.txt_Customerid.Text="";
this.txt_Companyname.Text="";
this.txt_Phone.Text="";
this.txt_Fax.Text="";
this.txt_Address.Text="";
this.txt_Country99.Text="";
}
}Top




