示例#1
0
        public static Object SQLHelper_ExecuteScalar(string Procedure_Name, List <SqlParameter> parameters)
        {
            try
            {
                _value = null;
                _sqlcom.CommandText = Procedure_Name;
                AdaptadorSQL.CreateParameters(parameters);
                _value = _sqlcom.ExecuteScalar();
                AdaptadorSQL.FillTable();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_value);
        }
示例#2
0
        public static Boolean SQLHelper_ExecuteNonQuery(string Procedure_Name, List <SqlParameter> parameters)
        {
            try
            {
                _result             = false;
                _sqlcom.CommandText = Procedure_Name;
                AdaptadorSQL.CreateParameters(parameters);
                _sqlcom.ExecuteNonQuery();
                AdaptadorSQL.FillTable();
                _result = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_result);
        }
示例#3
0
        public static DataTable SQLHelper_ExecuteReader(string Procedure_Name, List <SqlParameter> parameters)
        {
            DataTable _data = null;

            try
            {
                _data = null;
                _sqlcom.CommandText = Procedure_Name;
                AdaptadorSQL.CreateParameters(parameters);
                SqlDataAdapter _adapter = new SqlDataAdapter(_sqlcom);
                DataSet        dataset  = new DataSet("SQLHelper");
                _adapter.Fill(dataset);
                _data = dataset.Tables[0];
                AdaptadorSQL.FillTable();
                _sqltrn.Commit();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_data);
        }