DataGrid1.DataSource=dataset.Tables[0].De.....;第一張表
DataGrid1.DataBind();

DataGrid1.DataSource=dataset.Tables[1].De.....;第二張表
DataGrid1.DataBind();

解决方案 »

  1.   

    如果不想已经设置显示字段的话,设置DATAGRID的AutoGenerateColumns="False",
    DataGrid绑定数据表:
    SqlDa.SelectCommand.Connection = Conn
            If Not Page.IsPostBack Then
                SqlDa.SelectCommand.CommandText = "SELECT * from WorkFlowInstances where wftemplateid=" + Request("wtid") + " order by createdate desc"
                SqlDa.Fill(DSwf1, "WorkFlowInstances")
                DataGrid2.DataSource = DSwf1
                DataGrid2.DataBind()
            End If
      

  2.   

    以C#为例:
    DataSet cods=new DataSet();
    SqlDataAdapter coda = new SqlDataAdapter(你的SQL语句,connection对象名);
    coda.Fill(cods,"自定义表名");DataGrid.DataSource=coda;
    DataGrid.DataBind();
      

  3.   

    上面错了,应该是:
    以C#为例:
    DataSet cods=new DataSet();
    SqlDataAdapter coda = new SqlDataAdapter(你的SQL语句,connection对象名);
    coda.Fill(cods,"自定义表名");DataGrid.DataSource=cods;//cods,不是coda
    DataGrid.DataBind();
      

  4.   

    一张表两张表都是一样用SOL语句写出来作为连接字符串.
    本质上是一样的.
    你也可以做个视图放两张表的数据,不也是等于一张表嘛.