【求助】如何实现把统一数据库不同表中的数据加入同一个购物车
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;
using System.Data.OleDb;
public partial class fenye_Gou_Wu_Che : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//购物车信息显示
this.Label1.Text = "请确认您的购物清单";
//给出数据库路径和连接方式
string strPath = "App_Data/db.mdb";
string strConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Request.ServerVariables["APPL_PHYSICAL_PATH"] + strPath;
//生成OleDbConnection实例,构建数据库连接
OleDbConnection cn = new OleDbConnection(strConStr);
cn.Open();
//构建数据库实例
DataSet ds = new DataSet();
//构建表实例
DataTable dt = ds.Tables.Add("GouWuChe");
//构建表结构
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("zc", typeof(string));
dt.Columns.Add("zname", typeof(string));
dt.Columns.Add("xg", typeof(string));
dt.Columns.Add("price", typeof(string));
//定义键
DataColumn[] myKey = new DataColumn[1];
myKey[0] = dt.Columns["id"];
//将Session里的数据提取出来,并显示
string strSessionID = Convert.ToString(Session["id"]);
string[] strSessionIDS = strSessionID.Split('&');
for (int i = 0; i < strSessionIDS.Length - 1; i++)