有若干条SQL语句.select * from table where ...
select * from table where ...
select * from table where ...
select * from table where ...
select * from table where ...怎样一次执行这五条SQL语句,并把返回的五个Table装入一个DataSet中去呢?

解决方案 »

  1.   

    string sql="select * from ...; select * from .... ; select .....";
    ...
    da.Fill(ds);
      

  2.   

    objAdapter.Fill(ds,"table1");
    objAdapter.Fill(ds,"table2");
    objAdapter.Fill(ds,"table3");
    objAdapter.Fill(ds,"table4");
    objAdapter.Fill(ds,"table5");
      

  3.   

    不行啊.在 SQL 语句结尾之后找到字符。
      

  4.   

    我是创建了一个存储过程,然后再查询分析器里面查询处三个表。
    CREATE   PROCEDURE [threetable]
    AS
    SELECT * FROM [vod].[dbo].[MovieArea];
    SELECT * FROM [vod].[dbo].[MovieList];
    SELECT * FROM [vod].[dbo].[FilmUrl];
    GO
    确认存储过程有效Command(是一个SqlCommand) 调用存储过程。Query()方法是我自定义的Adapter.fill()方法了
    Command.CommandText="threetable";
    Command.CommandType=CommandType.StoredProcedure;
    return Query();
      

  5.   

    Access 数据库也可以创建存储过程吗?
      

  6.   

    http://www.pconline.com.cn/pcedu/empolder/db/access/0310/226080.html
    在 Access 中使用“存储过程”(一)
    看看这个教程了
      

  7.   

    select * from table where ...
    union all
    select * from table where ...
    union all
    select * from table where ...
    union all
    select * from table where ...
    union all
    select * from table where ...
    union all
    select * from table where ...
    用一条..
      

  8.   

    Access 数据库可以创建查询的