Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Offline Data Synchronization Services in Visual Studio 2008

Download

Right click “Save as…”

In this interview Milind Lele, Program Manager on the Visual Basic Team, shows us his favorite features - the new Data Synchronization designer in Visual Studio 2008 and how the sync services for ADO.NET work to support occasionally connected scenarios. He shows us how to set up a local database cache using SQL Compact Edition and how to use it to store read-only data caches as well as how to add the code to support two-way synchronization.

If anyone's ever tried to implement an occasionally connected smart client, they'll very much appreciate this new tooling and framework in Visual Studio 2008. For more information on sync services catch up on The Synchronizer blog.

Follow the Discussion

  • First of all this all seems a little too good to be true so hopefully i will be able to use this feature, i just have a few questions.

    My first question is that right now i am developing a system in which users will not always be connected, which will require them to be able to work off their laptops, so i have been working on a windows app that will use sql express, then have a seperate service running that will look after my synchronization, how ever one of our biggest problems here is that our data base is constantly changing which as i'm sure you know is a major pain when you have to write publications and renew all subscriptions everytime, What i am wondering is if there is an easy way that my database changes can automatically appear in the local database cache?  Or will i also have to create a new local cache with every database change?

    So basically my question is this, for everychange that is made to the database structure, will this result in recreating the local database cache object?

    My next question is will it be available for developers to use the tables in the local database cache in the LINQ to SQL Classes?  Since the two main features i would like to use by switching to 2008 would be built in synchronization and LINQ then i was hoping that it would have the ability to be laid over each other, however when ever i try to do this i am getting errors when i drag and drop from the server explorer.

    Anyway Thanks in advance
    Jeremy

  • > First of all this all seems a little too good to be true
    Thank you! Smiley

    > is if there is an easy way that my database changes can automatically appear in the local database cache?  Or will i also have to create a new local cache with every database change?

    There is no _easy_ way for the changes to automatically appear. But the good news is that with ADO .NET SyncServices you do not need to create a new local cache every time.

    The sync designer, as I show in the demo, creates change tracking information on the server. Thus whenever you call Synchronize() you fetch just what's changed since the last sync and just update your existing local cache.

    I should point out, however, that currently we support only SQL Server Compact.

    You can use LINQ to SQL with SQL Server Compact (although the OR designer in VS2008 does not support SQL Server Compact). You can define your DataContext (by hand) and the appropriate classes and use them.

    Thanks.

    Milind Lele
    PM, Visual Basic
     
  • Thank you for your presentation.  You made it look so simple. If you provide a direct link to this page in MSDN site , it will benefit so many other users( it is deeply hidden).
    I am trying to write a similar application  which syncs two File Folders. What I am interested is not in Syncing the two text file folders but to collect what is difference between the files with the same names ( knowledge) similar to Visual Source safe for eg. I parse the knowledge and post an update query to a back end database. I tried with PreviewMode = true, but I am not able to extract this knowledge.  Can you guide me to some sample code which can extract  knowledge content between two file folders ?
  • Very good presentation!

    I have one question, I have a centralserver with lots of user specific data. And I only want to get userspesific data synced to the client. For instance if you have several salespersons and one salesperson are only interested in customerdata, orders etc for his customers. How will I proceed to sync only subsets of data?

  • Hi! Great video about sync Services. I saw it when it came out on channel9. Thought I would return to the subject when any resource/tutorial/sample app including LINQ was available.

    But now it's January and I haven't been able to find anything on LINQ to SQL classes together with Sync Services.

    We're using mergereplication on the SQL2005 server right now.

    Would love to switch to an easier approach since we're going to implement local datacahce on all our WPF client apps and take some load and traffic of the SQL2005 server when clients sorting, filtering and still using the most recent data available.

    LINQ together with SyncService will allow us to stay flexible when new demands comes in from the customers.

    Any tip on samples,tutorials,videos.. is appreciated.


    rgds, Stanley

  • Vesuviusvesuvius Count Orlock
    stanley.broo@gbo.se wrote:
    

    Hi! Great video about sync Services. I saw it when it came out on channel9. Thought I would return to the subject when any resource/tutorial/sample app including LINQ was available.

    But now it's January and I haven't been able to find anything on LINQ to SQL classes together with Sync Services.

    We're using mergereplication on the SQL2005 server right now.

    Would love to switch to an easier approach since we're going to implement local datacahce on all our WPF client apps and take some load and traffic of the SQL2005 server when clients sorting, filtering and still using the most recent data available.

    LINQ together with SyncService will allow us to stay flexible when new demands comes in from the customers.

    Any tip on samples,tutorials,videos.. is appreciated.


    rgds, Stanley



    This will not work at present with Linq to SQL because Linq to SQL compact is not supported (yet). I create desktop applications (especially demos) using SQL compact (nice small imprint) using the SQL metal utility. This creates the necessary ORM and you can then use linq as long as you load the connection string in the constructor of the form/window you are using.

    Email me at mountvesuvius@hotmail.co.uk (I need to sort out my channel 9 email, pronto), if you need more info or get stuck.
  • Vesuviusvesuvius Count Orlock
    mackern wrote:
    

    Very good presentation!

    I have one question, I have a centralserver with lots of user specific data. And I only want to get userspesific data synced to the client. For instance if you have several salespersons and one salesperson are only interested in customerdata, orders etc for his customers. How will I proceed to sync only subsets of data?



    Lookes to me like you need to use Client Application Services. With CAS you this you can acheive the granularity you require.
  • Don't know if I explained my problem good enough.(Im not english...) What I want to do is filter the data that is being synced from the server. For instance sync only rows "where userid = @MyUserId" Instead of syncing all rows in the table as in this presantation. I guess it is quite common that a client doesn't need all data from a servertable.
  • Vesuviusvesuvius Count Orlock
    I cannot see that being a problem, but to be honest I would need to try it. I makes mre sense this way because it's more efficient. I will try doing this and update this thread.
  • Hello,

    Did this question ever get answered. I too have a need to sync only a subset of the data. Can this be done?
  • Typical Microsoft, the usual Marketing Strategy, everything is SALEs oriented the bottom line
    is products are Crude, Badly Written, full of bugs and nothing seems to work they way
    they say, it is all Sale, Sales,Sales, Marketing,Marketing, Marketing, the documentation is
    horrible, there is allways, I mean 100% some hidden crap you have to know or it does not work..

    I am tired of Microsoft, and cant wai to see Open source to to force MS to change their ways


    My opinion this Ocassionaly blah blah blah is another funky name for a very bad unreliable technology
    from MS like many other things, they are MASTERs of Marketing and funcky names havent you notice?

    REPLICA, TOPOLOGY......Wow, it used to be ROBUST a word they dont even know the meaning...or so it seems..

    What a joke, I know you guys are gonna have to change the way you do things and come around to crearte
    really usefull technology
  • Thanks for the great video.

    Question: We are developing a offline system in which users will not always be connected. We were thinking of using sync services but the main concern is our backend database which is Oracle. How will Oracle schema migration happen with SQL Server Compact. Are there any compatibility issues.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.