public override IKLink CreateLink()
		{
			DEBUG.IndentLine( "\n-- MyServer.CreateLink()" );
			DEBUG.WriteLine( "\n-- Connection Package = {0}", Package == null ? "<null>" : Package.ToString() );

			var dbServer = "Win2008Dev"; // Use your specific server
			var dbCatalog = "KeroseneDB"; // Use your specific database
			var multiple = true; // To support nested readers
			var connstr = SQLHelper.BuildConnectionString( dbServer, dbCatalog, multipleActiveResultSets: multiple );

			var link = new KLinkDirectSQL( connstr );
			link.AddParameterTransformer<CalendarDate>( x => CalendarDate.ToDateTime( x ) );
			link.AddParameterTransformer<ClockTime>( x => x.ToString() );

			DEBUG.Unindent();
			return link;
		}
Example #2
0
		static void Test_Direct_SQLServer()
		{
			Console.WriteLine( "\n===== Creating the link and registering the transformers ..." );
			var dbServer = "Win2008Dev"; // Use your specific server
			var dbCatalog = "KeroseneDB"; // Use your specific database
			var multiple = true; // To support nested readers
			var connstr = SQLHelper.BuildConnectionString( dbServer, dbCatalog, multipleActiveResultSets: multiple );

			var link = new KLinkDirectSQL( connstr );
			link.AddParameterTransformer<CalendarDate>( x => CalendarDate.ToDateTime( x ) );
			link.AddParameterTransformer<ClockTime>( x => x.ToString() );

			Console.WriteLine( "\n===== Executing the examples..." );
			Test_EasyMaps.Dispatcher( link );

			Console.Write( "\n===== Press [Enter] to dispose the link..." ); Console.ReadLine();
			link.Dispose();
		}