Esempio n. 1
0
        public void AttributeLicense()
        {
            DataContext context = new AccessDataContext {
                Log = Console.Out
            };

            Assert.IsNotNull(((SqlProvider)context.Provider).License);
            var license = (ALinqLicenseProvider.LicFileLicense)((SqlProvider)context.Provider).License;

            Assert.IsFalse(license.IsTrial);

            context = new SQLiteDataContext();
            Assert.IsNotNull(((SqlProvider)context.Provider).License);
            license = (ALinqLicenseProvider.LicFileLicense)((SqlProvider)context.Provider).License;
            Assert.IsFalse(license.IsTrial);

            context = new MySqlDataContext();
            Assert.IsNotNull(((SqlProvider)context.Provider).License);
            license = (ALinqLicenseProvider.LicFileLicense)((SqlProvider)context.Provider).License;
            Assert.IsFalse(license.IsTrial);

            context = new OracleDataContext();
            Assert.IsNotNull(((SqlProvider)context.Provider).License);
            license = (ALinqLicenseProvider.LicFileLicense)((SqlProvider)context.Provider).License;
            Assert.IsFalse(license.IsTrial);

            context = new OracleOdpDataContext();
            Assert.IsNotNull(((SqlProvider)context.Provider).License);
            license = (ALinqLicenseProvider.LicFileLicense)((SqlProvider)context.Provider).License;
            Assert.IsFalse(license.IsTrial);

            //context = new DataContext()
        }
Esempio n. 2
0
        static public DataSet GetSchemas(AccessDataContext info)
        {
            DataSet ds = new DataSet(ole_ace12);

            using (Access10 acedb = new Access10(info.source))
            {
                bool failedConnecting = false;
                using (OleDbConnection c = acedb.Connection)
                {
                    try { c.Open(); c.Close(); } catch { failedConnecting = true; }
                }
                if (failedConnecting)
                {
                    ErrorMessage.Show("Couldn't do it");
                    return(null);
                }
                using (OleDbConnection c = acedb.Connection)
                    using (OleDbDataAdapter a = new OleDbDataAdapter())
                    {
                        c.Open();
                        try {
                            Tds(c, ds);
                        } catch (Exception) {
                            throw;
                        };
                        c.Close();
                    }
            }
            return(ds);
        }