/// <summary> 
   /// 生成一个存储过程使用的sqlcommand. 
   /// </summary> 
   /// <param name="procName">存储过程名.</param> 
   /// <param name="prams">存储过程入参数组.</param> 
   /// <returns>sqlcommand对象.</returns> 
   public SqlCommand CreateCmd(string procName, SqlParameter[] prams) 
   { 
   SqlConnection Conn; 
   Conn = new SqlConnection(ConnStr); 
   Conn.Open(); 
   SqlCommand Cmd = new SqlCommand(procName, Conn); 
   Cmd.CommandType = CommandType.StoredProcedure; 
   if (prams != null) 
   { 
   foreach (SqlParameter parameter in prams) 
   { 
   if(parameter != null) 
   { 
   Cmd.Parameters.Add(parameter); 
   } 
   } 
   } 
   return Cmd; 
   }