public static void Main(string[] args)
        {
            // Invoke the ADO.NET connection demo
            Console.WriteLine("Starting the ADO.NET Connection Demo...");
            AdoConnectionDemo demo1 = new AdoConnectionDemo();
            demo1.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the ODBC connection demo
            Console.WriteLine("Starting the ODBC Connection Demo...");
            OdbcConnectionDemo demo2 = new OdbcConnectionDemo();
            demo2.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the OleDB connection demo
            Console.WriteLine("Starting the OLEDB Connection Demo…");
            OleDbConnectionDemo demo3 = new OleDbConnectionDemo();
            demo3.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the Entity Framework connection demo
            Console.WriteLine("Starting the Entity Framework Connection Demo...");
            EFConnectionDemo demo4 = new EFConnectionDemo();
            demo4.ConnectToSQLDatabase();
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            // Invoke the ADO.NET connection demo
            Console.WriteLine("Starting the ADO.NET Connection Demo...");
            AdoConnectionDemo demo1 = new AdoConnectionDemo();

            demo1.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the ODBC connection demo
            Console.WriteLine("Starting the ODBC Connection Demo...");
            OdbcConnectionDemo demo2 = new OdbcConnectionDemo();

            demo2.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the OleDB connection demo
            Console.WriteLine("Starting the OLEDB Connection Demo…");
            OleDbConnectionDemo demo3 = new OleDbConnectionDemo();

            demo3.ConnectToSQLDatabase(userName, password, datasource, databaseName);
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();

            // Invoke the Entity Framework connection demo
            Console.WriteLine("Starting the Entity Framework Connection Demo...");
            EFConnectionDemo demo4 = new EFConnectionDemo();

            demo4.ConnectToSQLDatabase();
            Console.WriteLine("Demo Complete... Press any key");
            Console.ReadKey();
        }