c#
DataSet ds = new DataSet();
SqlConnection sqlcon1 = new SqlConnection(Sqlstr);
sqlcon1.Open();
SqlDataAdapter da = new SqlDataAdapter("Prc_D_get_Server_info", sqlcon1);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.Fill(ds);sql存储过程Prc_D_get_Server_info:
CREATE PROCEDURE Prc_D_get_Server_info
AS begin
select depart_id,depart_name from rs_department
select * from rs_workstatus
select * from xm_xmfl
end
GO
这时,我只能用ds.Tables[0]、ds.Tables[1]获取数据,如果表多了,就很不方便,想用ds.Tables["rs_department"]的方式,该怎么修改存储过程呢?
DataSet ds = new DataSet();
SqlConnection sqlcon1 = new SqlConnection(Sqlstr);
sqlcon1.Open();
SqlDataAdapter da = new SqlDataAdapter("Prc_D_get_Server_info", sqlcon1);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.Fill(ds);sql存储过程Prc_D_get_Server_info:
CREATE PROCEDURE Prc_D_get_Server_info
AS begin
select depart_id,depart_name from rs_department
select * from rs_workstatus
select * from xm_xmfl
end
GO
这时,我只能用ds.Tables[0]、ds.Tables[1]获取数据,如果表多了,就很不方便,想用ds.Tables["rs_department"]的方式,该怎么修改存储过程呢?
http://www.nokiamobile.org.cn/12_090810_1998954.html
http://topic.csdn.net/u/20080321/15/39f3c000-a323-47e1-984f-678e4de6b204.html