コード例 #1
0
        }     //fin del metodo mEjecutar

        public Boolean mConectar(clsConexion cone)
        {
            try
            {
                conexion = new SqlConnection();
                conexion.ConnectionString = "user id='" + cone.getCodigo() + "';password='******';Data Source='" + mNomServidor() + "';Initial Catalog='" + this.baseDatos + "'";
                conexion.Open();
                return(true);
            }//fin del try
            catch
            {
                return(false);
            } //fin del catch
        }     //fin del metodo mConectar
コード例 #2
0
        }     //fin del metodo mSeleccionar

        public Boolean mEjecutar(string strSentencia, clsConexion cone)
        {
            try
            {
                if (mConectar(cone))
                {
                    comando = new SqlCommand(strSentencia, conexion);
                    comando.ExecuteNonQuery();
                    return(true);
                }//fin del if
                else
                {
                    return(false);
                }
            }//fin del try
            catch (Exception)
            {
                return(false);
            } //fin del catch
        }     //fin del metodo mEjecutar
コード例 #3
0
        }//fin del get

        #endregion

        #region Metodos
        public SqlDataReader mSeleccionar(string strSentencia, clsConexion cone)
        {
            try
            {
                if (mConectar(cone))
                {
                    comando             = new SqlCommand(strSentencia, conexion);
                    comando.CommandType = System.Data.CommandType.Text;//
                    return(comando.ExecuteReader());
                }//fin del if
                else
                {
                    return(null);
                }
            }//fin del try
            catch
            {
                return(null);
            } //fin del catch
        }     //fin del metodo mSeleccionar