Beispiel #1
0
        private static void ListDatabases()
        {
            string connStr = ConnectionStringManager.MakeSQLClient("sql.vnesoft.com", "", false, "Va!dO!#!167892g", "H@#d@Tag#6");
            var    df      = new DataFactory(DatabaseProvider.SqlClient, connStr);

            df.TestConnection();
            var ddl = df.Database.GetDatabases(true);

            Console.WriteLine(ddl.Count);
            var tdl = df.Database.GetTables();
        }
Beispiel #2
0
        private static void Dump(string query, string file)
        {
            Console.WriteLine("doing " + file);
            var df = new DataFactory(DatabaseProvider.SqlClient, ConnectionStringManager.MakeSQLClient("la1db2-dev-vm.mscorp.com", "testDb", true, null, null));

            df.TestConnection();

            var dt = df.FillTable(query);

            using (var w = new StreamWriter(file, false, Encoding.ASCII))
            {
                foreach (DataRow dr in dt.Rows)
                {
                    w.WriteLine(dr["foo"].ToString());
                }

                w.Flush();
                w.Close();
            }
        }