示例#1
0
        public void SybaseAnyWhereTest()
        {
            const string providername     = "iAnyWhere.Data.SQLAnyWhere";
            const string connectionString = "Data Source=SQL Anywhere 12 Demo";

            ProviderChecker.Check(providername, connectionString);

            DiscoverProviderFactory.Discover(connectionString, providername);

            var dbReader = new DatabaseReader(connectionString, providername, 0);
            var schema   = dbReader.ReadAll();

            Assert.IsTrue(schema.Tables.Count > 0);
        }
示例#2
0
        public void SybaseAseTest()
        {
            //using pubs3 with default sa account with Ase Developer Edition 15 on localhost (had to use IP address to get it to connect)
            const string providername     = "Sybase.Data.AseClient";
            const string connectionString = "Server=192.168.1.100;Port=5000;Uid=sa;Pwd='';Initial Catalog=pubs3";

            ProviderChecker.Check(providername, connectionString);

            DiscoverProviderFactory.Discover(connectionString, providername);

            var dbReader = new DatabaseReader(connectionString, providername, 0);
            var schema   = dbReader.ReadAll();

            Assert.IsTrue(schema.Tables.Count > 0);
        }
示例#3
0
        public void MySqlViaDevartTest()
        {
            const string providername     = "Devart.Data.MySql";
            var          connectionString = ConnectionStrings.MySqlDevart;

            ProviderChecker.Check(providername, connectionString);

            DiscoverProviderFactory.Discover(connectionString, providername);
            var dbReader = new DatabaseReader(connectionString, providername);

            dbReader.Owner = "sakila";
            var schema  = dbReader.ReadAll();
            var country = schema.FindTableByName("country");

            Assert.AreEqual(3, country.Columns.Count);
            Assert.IsNotNull(country.PrimaryKeyColumn);

            var table = dbReader.Table("city");

            Assert.AreEqual(4, table.Columns.Count);
        }
示例#4
0
        public void TestAccess2007()
        {
            const string providername = "System.Data.OleDb";
            const string dir          = @"C:\Data\Nwind.accdb";

            if (!File.Exists(dir))
            {
                Assert.Inconclusive("Access test requires database file " + dir);
            }

            const string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dir;

            ProviderChecker.Check(providername, connectionString);

            DiscoverProviderFactory.Discover(connectionString, providername);

            var dbReader = new DatabaseReader(connectionString, providername);
            var schema   = dbReader.ReadAll();
            var table    = schema.FindTableByName("Products");

            Assert.IsTrue(table.Columns.Count > 0);
        }