Пример #1
0
        public static int ScoopSqlCommandCount(string sql, SqlParameter[] parameter = null)
        {
            var dataTable = new System.Data.DataTable();

            try
            {
                dataTable = DataTableProses.GetDataTableSqlDataAdapter(sql, parameter, dataTable);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }


            return((int)dataTable.Rows[0][0]);
        }
Пример #2
0
        public static List <T> ScoopSqlCommand(string sql, SqlParameter[] parameter = null)
        {
            var dataTable = new System.Data.DataTable();

            try
            {
                dataTable = DataTableProses.GetDataTableSqlDataAdapter(sql, parameter, dataTable);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            var anonimT = DataTableConvert.DataTableToList <T>(dataTable);

            return(anonimT);
        }