Exemple #1
0
        public DataTable FindTable(string sql, params IDbDataParameter[] parameters)
        {
            var conn = dataBase.DbContext.Database.GetDbConnection();
            var cmd  = conn.CreateCommand();

            cmd.CommandText = sql;
            cmd.Parameters.AddRange(parameters);
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            return(DataConvert.ConvertDataReaderToDataTable(cmd.ExecuteReader()));
        }