1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public IEnumerable<dynamic> ExecQuery(string query) { try { ConnectionString = $"Data Source = {server}; Initial Catalog = {DB}; User ID = {userID}; Password ={password}"; conn.Open(); result = conn.Query(query); return result; } catch (Exception ie) { } finally { conn.Close(); } return null; }
|