日期:2014-05-19  浏览次数:20959 次

C#调用存储过程返回值为null,不知道什么原因。
操作存储过程代码如下:
  #region   数据库连接
                ///   <summary>
                ///   打开数据库连接.
                ///   </summary>
                private   void   Open()
                {
                        //   打开数据库连接
                        if   (con   ==   null)
                        {
                                con   =   new   SqlConnection(connectionString);
                        }
                        if   (con.State   ==   System.Data.ConnectionState.Closed)
                                con.Open();
                }
                ///   <summary>
                ///   关闭数据库连接
                ///   </summary>
                public   void   Close()
                {
                        if   (con   !=   null)
                                con.Close();
                }
                ///   <summary>
                ///   释放资源
                ///   </summary>
                public   void   Dispose()
                {
                        //   确认连接是否已经关闭
                        if   (con   !=   null)
                        {
                                con.Dispose();
                                con   =   null;
                        }
                }
                #endregion

                #region   存储过程操作
        &nb