using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using DataAccess.Core;
using DataAccess.SqlServer;
using DataAccess.Core.Interfaces;
using System.Diagnostics;
using System.Data.SqlClient;
using DataAccess.MySql;
using System.Collections;

namespace SauceExample
{
  public class CrudClass
  {
    public static IDataStore _sqlServer; //I recommend keeping the reference around
    public static IDataStore _mySQL; //I recommend keeping the reference around

    static CrudClass()
    {
      _sqlServer = SqlServerConnection.GetDataStore(ConfigurationManager.ConnectionStrings["SqlServer"].ConnectionString);
      _mySQL = MySqlServerConnection.GetDataStore(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);
    }

    [STAThread]
    public static void Main(string[] args)
    {
      Stopwatch watch = new Stopwatch();
      watch.Start();
      _mySQL.InsertObjects((IList)_sqlServer.LoadEntireTable<MyObject>());


      watch.Stop();
      Console.Read();
    }
  }
}

Last edited May 30, 2013 at 3:21 AM by iamkrillin, version 2

Comments

No comments yet.