源代码如下:SqlConnection myConn = new SqlConnection(ConfigurationSettings.AppSettings["strConn"]);
myConn.Open();
SqlCommand myCmd;
myCmd = new SqlCommand("sp_Functions_SelByStaffID",myConn);
myCmd.CommandType = CommandType.StoredProcedure;

myCmd.Parameters.Add("@StaffID",SqlDbType.Int,4);
myCmd.Parameters["@StaffID"].Value = Session["operatorID"];

SqlParameter ParaResult = myCmd.Parameters.Add("@Status",SqlDbType.Int);
ParaResult.Direction = ParameterDirection.Output;

SqlParameter ParaResult1 = myCmd.Parameters.Add("@Errmsg",SqlDbType.NVarChar,255);
ParaResult1.Direction = ParameterDirection.Output; SqlDataAdapter myDA = new SqlDataAdapter(); DataSet ds = new DataSet();
myDA.SelectCommand = myCmd;
myDA.Fill(ds,"Functions");
myCmd = new SqlCommand("sp_Functions_SelByParentID",myConn);
myCmd.CommandType = CommandType.StoredProcedure; myCmd.Parameters.Add("@ParentID",SqlDbType.Int,4);
myCmd.Parameters["@ParentID"].Value = ds.Tables["Functions"].Columns["FunID"];

SqlParameter ParaResult2 = myCmd.Parameters.Add("@Status",SqlDbType.Int);
ParaResult2.Direction = ParameterDirection.Output;

SqlParameter ParaResult3 = myCmd.Parameters.Add("@Errmsg",SqlDbType.NVarChar,255);
ParaResult3.Direction = ParameterDirection.Output; myDA.SelectCommand = myCmd;
myDA.Fill(ds,"Parent"); myConn.Close();大家帮帮看看吧