大家可以帮我看看这段代码有什么错吗?为什么一直报找不到tables 0
public partial class gouwuche : System.Web.UI.Page
{
DataTable cart;
Double TtlPrice;
BLL.goods goodsbll = new BLL.goods();
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Image9.Visible = false;
LabMessage.Visible = false;
shoplist();
}
}
protected void shoplist()
{
Hashtable Hash;
if (Session["car"] == null)
{
Hash = new Hashtable();
}
else
{
Hash = (Hashtable)Session["car"];
}
if (Hash.Count == 0)
{
Image9.Visible = true;
LabMessage.Visible = true;
LabMessage.Text = "您还没有购物呢?赶快购物吧!";
}
string[] ArrKey = new string[Hash.Count];
int[] ArrVal = new int[Hash.Count];
string Goods = "('";
Hash.Keys.CopyTo(ArrKey, 0);
Hash.Values.CopyTo(ArrVal, 0);
int k = 0;
for (int j = 0; j < ArrKey.Length; j++)
{
if (k > 0) Goods += "','"; k++;
Goods += ArrKey.GetValue(j).ToString();
}
Goods += "')";
DataSet ds = goods.GetList("G_No in" + Goods);
DataTable Table1 = new DataTable();
Table1 = ds.Tables[0] ;
//Table1 = ds.Tables["Goods"];
Table1.Columns.Add(new DataColumn("Number", System.Type.GetType("System.Int32")));
DataColumn[] Keys = { Table1.Columns["ID"] };
Table1.PrimaryKey = Keys;
foreach (string X in Hash.Keys)
{
Table1.Rows.Find(X)["Number"] = Hash[X];
}
Table1.Columns.Add(new DataColumn("Label1", System.Type.GetType("System.Double"), "price*Number"));
for (int I = 0; I < Table1.Rows.Count; I++)
{
TtlPrice += Convert.ToDouble(Table1.Rows[I]["price"]);
}
Label1.Text = TtlPrice.ToString();
Session["Total"] = Label1.Text.ToString();
GridView2.DataSource = Table1.DefaultView;
GridView2.DataBind();
}
protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{
Hashtable Hash;
if (Session["car"] == null)
{
Hash = new Hashtable();
}
else
{
Hash = (Hashtable)Session["car"];
}
if (Hash.ContainsKey(e.CommandArgument))
{
Hash.Remove(e.CommandArgument);
}
LabMessage.Text =