同时使用多个聚合函数,
如果是select count(*) as count1,sum(mymoney) as mymoney ...
就用reader
int count1 = 0;decimal mymoney = .0;if(yourreader.read())//判断结果集中是否有记录{ count1 = (int)yourreader[0]; mymoney = (decimal)yourreader[1];}
同时使用多个聚合函数,
如果是select count(*) as count1,sum(mymoney) as mymoney ...
就用reader
int count1 = 0;decimal mymoney = .0;if(yourreader.read())//判断结果集中是否有记录{ count1 = (int)yourreader[0]; mymoney = (decimal)yourreader[1];}