调用代返回参数的存储过程

//string connStr = ConfigurationManager.AppSettings["ConnectionString"].ToString();
   
            //SqlConnection conn = new SqlConnection(connStr);
            //conn.Open();
            //SqlCommand MyCommand = new SqlCommand("ifContractCanChange", conn);
            //MyCommand.CommandType = CommandType.StoredProcedure;
            //MyCommand.Parameters.Add(new SqlParameter("@contractId", SqlDbType.VarChar, 20));
            //MyCommand.Parameters["@contractId"].Value = strCid;
          
            //MyCommand.Parameters.Add(new SqlParameter("@result", SqlDbType.TinyInt));
            //MyCommand.Parameters["@result"].Direction = ParameterDirection.Output;
            //MyCommand.Parameters.Add(new SqlParameter("@reason", SqlDbType.NVarChar,50));
            //MyCommand.Parameters["@reason"].Direction = ParameterDirection.Output;
            //MyCommand.ExecuteNonQuery();
          
            //result =Convert .ToInt32(MyCommand.Parameters["@result"].Value.ToString());
            //reason = MyCommand.Parameters["@reason"].Value.ToString();

posted @ 2009-05-26 09:08  xumingming  阅读(171)  评论(0编辑  收藏  举报