日期:2014-05-18  浏览次数:20716 次

SqlDataReader.NextResult问题
SQL code

select sum(MealNumber) as 'sum',MealName from #meal group by MealName
select * from #meal  where persontype = 1 order by MealDate,MealName
select * from #meal where personType = 2 order by MealDate,MealName


C#
C# code

  string sql = @"select sum(MealNumber) as 'sum',MealName from #meal group by MealName
                select * from #meal  where persontype = 1 order by MealDate,MealName
                select * from #meal where personType = 2 order by MealDate,MealName";
comm.commandText = sql;
SqlDataReader dr = comm.ExecuteReader();



怎么做才能把不同的查询结果放在单独的Table里面啊

------解决方案--------------------
Union?
------解决方案--------------------
你可以不用table阿 你用datagridview来放查询出的数据阿