none
Simple N-Tier example for SQL Server / SQL Server Express needed RRS feed

  • Question

  • Anyone can provide a simple N-Tier example for SQL Server / SQL Server Express?

    I need to sync a server running sql server (windows server 2008) and a client runing sql server express (windows xp). i have downloaded the demo "WebSharingAppDemo-SqlProviderEndToEnd", and i cannot figure out what's happening.

    anyone can provide a very simple app with server side code and client side code which is connected by using asp.net web service or wcf.

    If anybody has a simple example it would be greatly appreciated.

    Tuesday, September 28, 2010 1:46 PM

Answers

All replies

  • The sample provided was simple enough for me, I was able to get my scenario up and running based off of it even with some fancy compression(3 million records in 45 min!!). I found that you do not need to fully understand the concepts in the sample to get it running, but when it comes time to customize for your own consumption, you need to much more detailed understanding of what is going on. its time on your part, read the docs, MSDN... I would not expect any simpler sample...
    Tuesday, September 28, 2010 2:28 PM
  • The sample is more than enough to get you started. the only thing you need to work on is how to get the data which you got from SQL Server into SQL Express which is currently in your local cache.

     

     

    Tuesday, September 28, 2010 2:52 PM
  • Hey Zhongchen,

    Did you check out the redme file for the sample you download? The readme file includes the install instruction and how to run and debug this sample which might be helpful.

     

    Thanks,


    Ann Tang
    Tuesday, September 28, 2010 6:47 PM
  • if you download Sync Fx 2.1, the documentation contains step by step walkthroughs on how to setup synchronization. its much easier to understand as an introduction then you can move on to the WCF stuff. when you look at the sample code, the only difference with the walkthroughs will be the WCF service part.
    Tuesday, September 28, 2010 11:09 PM
    Moderator
  • Hi Ann Tang

    I can set it up and get it run.

    What i cannot get through is how can i separate the code to server side and client side, how should i handle the connection to the remote database by using proxy on the local computer and a service on the server.

    my understanding is that there is a proxy on the client computer, which should be a wcf client, and communicate with remote computer which is hosting a wcf host. the client computer should sync local data and data comes from proxy, server computer should sync server data and data comes from proxy as well. please let me know if i am wrong.

    the following instructions in the sample

    4.  The Synchronize button is disabled until at least one new SQL Server peer is added. Add a new SQL Server database by clicking "Add SQL Peer". SQL Server can be on local or remote machines with Windows NT integrated security or the given username and password.

    to me, there is still a direct connection to remote server rather, i donot know what is the point of using wcf then.

    and also with the following configuration

    <add baseAddress="http://localhost:8000/RelationalSyncContract/SqlSyncService/"/>

    i didnot see how client computer is involved in the WCF communication.

    what i really want to know is how to create a proper proxy and connect to a server WCF or ASP.NET Web Service, and then separate server and client code, which is not clear shown in the sample.

    please pointed it out if i miss something.

    Thank you

    Wednesday, September 29, 2010 2:45 PM
  • Hi JuneT

    I have read all the documentation regarding to database sync.

    I can set that sample up and get it run.

    What i cannot get through is how can i separate the code to server side and client side, how should i handle the connection to the remote database by using proxy on the local computer and a service on the server.

    my understanding is that there is a proxy on the client computer, which should be a wcf client, and communicate with remote computer which is hosting a wcf host. the client computer should sync local data and data comes from proxy, server computer should sync server data and data comes from proxy as well. please let me know if i am wrong.

    the following instructions in the sample

    4.  The Synchronize button is disabled until at least one new SQL Server peer is added. Add a new SQL Server database by clicking "Add SQL Peer". SQL Server can be on local or remote machines with Windows NT integrated security or the given username and password.

    to me, there is still a direct connection to remote server rather, i donot know what is the point of using wcf then.

    and also with the following configuration

    <add baseAddress="http://localhost:8000/RelationalSyncContract/SqlSyncService/"/>

    i didnot see how client computer is involved in the WCF communication.

    what i really want to know is how to create a proper proxy and connect to a server WCF or ASP.NET Web Service, and then separate server and client code, which is not clear shown in the sample.

    please pointed it out if i miss something.

    Thank you

    Wednesday, September 29, 2010 2:46 PM
  • Sorry

    I didnot notice  this method.

    protected override void CreateProxy()

    now i can figure it out.

    Thanks

    Thursday, September 30, 2010 2:44 AM