none
What will be the client provider for LocalDB (SQL Server Denali) RRS feed

  • Question

  • Hi all,

    I am trying to do a sync application that syncs data between a SQL Server (2008 R2) (Server) and a LocalDB (SQL Server denali CTP 3).

     

    I am following this link : http://msdn.microsoft.com/en-us/library/bb726015.aspx#Y617

     

    The LocalDB uses OledbConnection to connect as shownbelow, but i am not able to do this in the Client sync provider.

     

    The code to access Local Db is this :

    string ConnectionString = @"Provider=SQLNCLI11.1;Data Source=(localdb)\v11.0;Persist Security Info=False;Integrated Security=SSPI;Initial File Name=D:\All Trials\MDFFiles\Sample.mdf";
            
            DataSet MyDS = new DataSet();
    
            OleDbConnection MyConn1 = new OleDbConnection(ConnectionString);
            string a = MyConn1.Database;
            MyConn1.Open();
    
    
            OleDbCommand MyCommand = new OleDbCommand("SELECT * from dbo.Users", MyConn1);
    
            OleDbDataAdapter MyAdapter = new OleDbDataAdapter(MyCommand);
    
            MyAdapter.Fill(MyDS);
    

    The clientSync provider as given in the sample is :

    public class SampleClientSyncProvider : SqlCeClientSyncProvider
      {
    
        public SampleClientSyncProvider()
        {
          //Specify a connection string for the sample client database.
          Utility util = new Utility();
          this.ConnectionString = Utility.ConnStr_SqlCeClientSync;
        }
      }
    
    

    But if i use SqlCeClientSyncProvider it doensot allow me to pass connection, it allows me to only pass the Connection string. If i pass the above connection string it doesnot work.

     

    Any ideas ?

     

    Another question here : The serverSync is currently a direct SQLConnection. if i have to change the connection to consume from a WCF service questions are :

     

    1. Does this type of approach for synchronization with WCF webservice work (the pattern in Link)

    2. If yes, are there any samples or any approach ?

     

    - Girija


    Girija Shankar Beuria
    Wednesday, August 3, 2011 4:57 AM

Answers

All replies