示例#1
0
        private static void PerfTest()
        {
			SqlConnectionStringBuilder database = new SqlConnectionStringBuilder(connectionString);
            using (var connection = database.Connection())
            {
                connection.Open();
                var results = connection.QuerySql<PerfTestData>("SELECT Int=1, String='2', Decimal=3, [Double]=4");

                PerformanceTest.WithDurationAndKeyWait(3, 1 * 1000, () =>
                {
                    results = connection.QuerySql<PerfTestData>("SELECT Int=1, String='2', Decimal=3, [Double]=4");
                });
            }
        }
示例#2
0
		static void SqlConnectionStringBuilder_Connection()
		{
			SqlConnectionStringBuilder database = new SqlConnectionStringBuilder(connectionString);
			// make other changes here

			// run a query right off the connection (this performs an auto-open/close)
			database.Connection().QuerySql("SELECT * FROM Beer", Parameters.Empty);
		}