create proc dbo.procxx1
(
@datatime1 datatime )as
select b_date,b_name,b_type,b_quantity,s_name 
(
SELECT A.b_sn, a.b_date, a.b_quantity, b.s_name,c.b_name, c.b_type  FROM dbo.accessories_in a INNER JOIN dbo.stuff b ON a.b_person_in = b.s_code INNER JOIN dbo.accessories_code c ON a.b_code_sn = c.b_sn 
)dwhere b_date= @datatime1如何return 以上数据集????
go

解决方案 »

  1.   

    举一个例子
    create proc dbo.procxx1
    @datatime1 datatime 
    as
    select b_date,b_name,b_type,b_quantity,s_name from bwhere b_date= @datatime1
      

  2.   


    将数据插入TmpTable,可得到数据集,使用后删除临时表
      

  3.   

    直接程序里
    用datatable存放数据集
    DbDataReader reader = command.ExecuteReader();
    table = new DataTable();
    table.Load(reader);
    然后table绑定前台数据源 我常这样弄
      

  4.   

    正式开始学习sql,过几天来灌水...^_^
      

  5.   

    将数据插入TmpTable,可得到数据集,使用后删除临时表