/// <summary> /// <see cref="https://github.com/jonwagner/Insight.Database"/> /// </summary> static void InsightDatabase_Example() { InsightDbProvider.RegisterSqlProvider(); var conn = new SqlConnection(@"Data Source=www.machinejar.com\DEVSQL02;Initial Catalog=AdventureWorks2014;Persist Security Info=True;User ID=db_user;Password=***"); var productAddresses = conn.QuerySql<dynamic>("select top 10 * from Person.Address"); Console.WriteLine(productAddresses.First().AddressLine1); Console.ReadLine(); }
static void IDBConnection_OpenConnection() { // open the connection and return it using (SqlConnection c = new SqlConnection(connectionString).OpenConnection()) { c.QuerySql("SELECT * FROM Beer", Parameters.Empty); } }