public override void StringConnect() { var connstr = string.Format("Data Source={0};User ID=Northwind;Password=Test", NorthwindDatabase.DB_HOST); var context = new ALinq.DataContext(connstr, typeof(ALinq.Oracle.Odp.OracleProvider)); context.Connection.Open(); context.Connection.Close(); }
public void StringConnect() { var connstr = CreateConnection().ConnectionString; var context = new ALinq.DataContext(connstr, typeof(ALinq.SqlClient.Sql2005Provider)); context.Connection.Open(); context.Connection.Close(); }
public void temp() { //var formatFlags = QueryFormatOptions.None; //Assert.AreEqual(formatFlags & QueryFormatOptions.SuppressSize, QueryFormatOptions.None); var context = new ALinq.DataContext("C:/Northwind.mdb", typeof(ALinq.Access.AccessDbProvider)); var product = context.GetTable <Product>(); var tables = context.Mapping.GetTables().ToArray(); Console.WriteLine(tables.Count()); }
public void LicenseTest2() { var access = new ALinq.DataContext("C:/Northwind.mdb", typeof(ALinq.Access.AccessDbProvider)) { Log = Console.Out }; var q = access.GetTable <Customer>().ToList(); var sqlLite = new ALinq.DataContext("C:/Northwind.db3", typeof(ALinq.SQLite.SQLiteProvider)) { Log = Console.Out }; q = sqlLite.GetTable <Customer>().ToList(); var conn = MySqlNorthwind.CreateConnection("root", "test", "Northwind", NorthwindDatabase.DB_HOST, 3306).ConnectionString; var mysql = new ALinq.DataContext(conn, typeof(ALinq.MySQL.MySqlProvider)) { Log = Console.Out }; q = mysql.GetTable <Customer>().ToList(); conn = OracleNorthwind.CreateConnection("Northwind", "test", "vpc1").ConnectionString; var oracle = new ALinq.DataContext(conn, typeof(ALinq.Oracle.OracleProvider)) { Log = Console.Out }; q = oracle.GetTable <Customer>().ToList(); conn = OdpOracleNorthwind.CreateConnection("Northwind", "test", "vpc1").ConnectionString; var odpOracle = new ALinq.DataContext(conn, typeof(ALinq.Oracle.Odp.OracleProvider)) { Log = Console.Out }; q = oracle.GetTable <Customer>().ToList(); conn = "User=SYSDBA;Password=masterkey;Database=Northwind;DataSource=vpc1;ServerType=0"; var firebird = new ALinq.DataContext(conn, typeof(ALinq.Firebird.FirebirdProvider)) { Log = Console.Out }; q = firebird.GetTable <Customer>().ToList(); conn = "DataBase=SAMPLE;USER ID=db2admin;Password=test;Server=VPC1"; var db2 = new ALinq.DataContext(conn, typeof(ALinq.DB2.DB2Provider)) { Log = Console.Out }; q = db2.GetTable <Customer>().ToList(); }