Ejemplo n.º 1
0
        public DataTable ExecuteQuery(string sqlText)
        {
            DataTable dataTable = new DataTable();
            var       cmd       = conn.CreateCommand();

            cmd.CommandText = sqlText;
            var adapter = new DmDataAdapter(cmd);

            adapter.Fill(dataTable);
            return(dataTable);
        }
Ejemplo n.º 2
0
        public DataTable ExecuteProcedureQuery(string sqlText, params DbParameter[] parameters)
        {
            DataTable dataTable = new DataTable();
            var       cmd       = conn.CreateCommand();

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = sqlText;
            cmd.Parameters.AddRange(parameters);
            var adapter = new DmDataAdapter(cmd);

            adapter.Fill(dataTable);
            return(dataTable);
        }