Saturday, February 25, 2012

Application needs replication

Hi
We have an MS Access application which runs on the server but some laptop
users need the app to work offline. Our solution has been to use Access
replication which automatically syncs data (both ways) when laptop is
connected to the network. We are looking to rewrite the app to vb.net/sql
server. My question is how does replication work in sql server specially in
context of a vb.net front end i.e. what sort of coding/configuration we are
we looking at?
Thanks
RegardsWell since you will have disconnected users; you will need to have a local
instance of the SQL Server installed on the computer. Then you can SQL
Server 2005 Merge Replication Topology to do what yaa needed. Read up on it
at ..
http://technet.microsoft.com/en-us/sqlserver/bb331775.aspx
Thanks!
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"John" wrote:
> Hi
> We have an MS Access application which runs on the server but some laptop
> users need the app to work offline. Our solution has been to use Access
> replication which automatically syncs data (both ways) when laptop is
> connected to the network. We are looking to rewrite the app to vb.net/sql
> server. My question is how does replication work in sql server specially in
> context of a vb.net front end i.e. what sort of coding/configuration we are
> we looking at?
> Thanks
> Regards
>
>|||Am I right to believe I need to code as if my app is connected to the same
single sql server and various sql server installs would automatically take
care of the sync between themselves without intervention by app when laptops
are connected to the network?
Thanks
Regards
"Mohit K. Gupta" <mohitkgupta@.msn.com> wrote in message
news:D4FD10E6-2DF6-486A-B6F9-88000C5A076A@.microsoft.com...
> Well since you will have disconnected users; you will need to have a local
> instance of the SQL Server installed on the computer. Then you can SQL
> Server 2005 Merge Replication Topology to do what yaa needed. Read up on
> it
> at ..
> http://technet.microsoft.com/en-us/sqlserver/bb331775.aspx
> Thanks!
> --
> Mohit K. Gupta
> B.Sc. CS, Minor Japanese
> MCTS: SQL Server 2005
>
> "John" wrote:
>> Hi
>> We have an MS Access application which runs on the server but some laptop
>> users need the app to work offline. Our solution has been to use Access
>> replication which automatically syncs data (both ways) when laptop is
>> connected to the network. We are looking to rewrite the app to vb.net/sql
>> server. My question is how does replication work in sql server specially
>> in
>> context of a vb.net front end i.e. what sort of coding/configuration we
>> are
>> we looking at?
>> Thanks
>> Regards
>>|||In a sense yes, but actually no. What I mean is, since you will have a
local install of SQL Server on each laptop; you can code the application to
connect to localhost and no coding required for developer for connecting
parts. But in fact; these are all different instances of SQL Server on
different computer, everyone will have different names.
I haven't coded for replication enviornment, but few challanges that face
you developers is handling merge conflicts. Three possible cases can happen:
1) Record is updated, but no longer exists.
2) Insert a record; and causes a duplicate primary key.
3) Updating same records in two locations, both valid but are in conflict.
Replication is usually timed event; so onces the server is on the network,
the local server will talk to the distributor and the publitioning database
to update information as needed. I hope this gives you some ideas. Thanks!
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
"John" wrote:
> Am I right to believe I need to code as if my app is connected to the same
> single sql server and various sql server installs would automatically take
> care of the sync between themselves without intervention by app when laptops
> are connected to the network?
> Thanks
> Regards
> "Mohit K. Gupta" <mohitkgupta@.msn.com> wrote in message
> news:D4FD10E6-2DF6-486A-B6F9-88000C5A076A@.microsoft.com...
> > Well since you will have disconnected users; you will need to have a local
> > instance of the SQL Server installed on the computer. Then you can SQL
> > Server 2005 Merge Replication Topology to do what yaa needed. Read up on
> > it
> > at ..
> > http://technet.microsoft.com/en-us/sqlserver/bb331775.aspx
> >
> > Thanks!
> > --
> > Mohit K. Gupta
> > B.Sc. CS, Minor Japanese
> > MCTS: SQL Server 2005
> >
> >
> > "John" wrote:
> >
> >> Hi
> >>
> >> We have an MS Access application which runs on the server but some laptop
> >> users need the app to work offline. Our solution has been to use Access
> >> replication which automatically syncs data (both ways) when laptop is
> >> connected to the network. We are looking to rewrite the app to vb.net/sql
> >> server. My question is how does replication work in sql server specially
> >> in
> >> context of a vb.net front end i.e. what sort of coding/configuration we
> >> are
> >> we looking at?
> >>
> >> Thanks
> >>
> >> Regards
> >>
> >>
> >>
>
>|||John,
You have at least two possiblilties, use a replication of the SQL server
using by instance SQL Client, or make your application in a way that it uses
DataSets from the needed information.
The latter is very easy to do and the way I would go in your situation.
Cor|||And you don't need SQL Server installed on the client(s). Another
alternative is SQL Server Compact Edition on the clients. It can also act as
a Subscriber to a SQL Server Publisher. Note that a SQL Server Publisher
must be Workgroup or better--SQL Express does not support this
functionality. In addition, you might consider using the new ADO.NET 3.5
Sync Services due out with Orcas (before the end of the year). In this case
you don't need SQL Server to act as a Publisher.
I discuss most of these options in my Ebook on SQL CE.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O4l0ZMECIHA.324@.TK2MSFTNGP04.phx.gbl...
> Hi
> We have an MS Access application which runs on the server but some laptop
> users need the app to work offline. Our solution has been to use Access
> replication which automatically syncs data (both ways) when laptop is
> connected to the network. We are looking to rewrite the app to vb.net/sql
> server. My question is how does replication work in sql server specially
> in context of a vb.net front end i.e. what sort of coding/configuration we
> are we looking at?
> Thanks
> Regards
>|||Hi Cor
Thanks. How does one keep data persistent on client side when using
datasets, bearing in mind that clients (laptops) will be disconnected from
the network/sql server often but would need access to sql server data
offline? If you can point to some reading that would be great.
Many Thanks
Regards
"Cor Ligthert[MVP]" <notmyfirstname@.planet.nl> wrote in message
news:14F13D20-64C8-46CB-BEF1-CC700A4A6474@.microsoft.com...
> John,
> You have at least two possiblilties, use a replication of the SQL server
> using by instance SQL Client, or make your application in a way that it
> uses DataSets from the needed information.
> The latter is very easy to do and the way I would go in your situation.
> Cor
>|||Take a look at Sybase SQL Anywhere. It's replication capabilities are truly
amazing.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O4l0ZMECIHA.324@.TK2MSFTNGP04.phx.gbl...
> Hi
> We have an MS Access application which runs on the server but some laptop
> users need the app to work offline. Our solution has been to use Access
> replication which automatically syncs data (both ways) when laptop is
> connected to the network. We are looking to rewrite the app to vb.net/sql
> server. My question is how does replication work in sql server specially
> in context of a vb.net front end i.e. what sort of coding/configuration we
> are we looking at?
> Thanks
> Regards
>|||John,
The nature from a dataset is to work ofline, it is build for that.
When you do an update, there is looked if there has been a change (this is
called optimistic concurrency). The way as the data is organised makes that
the chanch for that is low or high.
By instance as you are adding and subtrackting values from tablerows,
instead of adding mutation rows, then you can probably forget it.
Cor|||Ah, I expect he means you can serialize the DataTable(s) to an XML file or
somesuch.
Again, the SQL Server Compact Edition (which supports several kinds of
replication) is a better option.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Cor Ligthert[MVP]" <notmyfirstname@.planet.nl> wrote in message
news:522F9B5D-D648-4D7B-99F1-58EAB1B33923@.microsoft.com...
> John,
> The nature from a dataset is to work ofline, it is build for that.
> When you do an update, there is looked if there has been a change (this is
> called optimistic concurrency). The way as the data is organised makes
> that the chanch for that is low or high.
> By instance as you are adding and subtrackting values from tablerows,
> instead of adding mutation rows, then you can probably forget it.
> Cor|||Thanks Bill.
Regards
"William Vaughn" <billvaNoSPAM@.betav.com> wrote in message
news:OYv3bNdCIHA.6012@.TK2MSFTNGP03.phx.gbl...
> Ah, I expect he means you can serialize the DataTable(s) to an XML file
> or somesuch.
> Again, the SQL Server Compact Edition (which supports several kinds of
> replication) is a better option.
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> ------
> "Cor Ligthert[MVP]" <notmyfirstname@.planet.nl> wrote in message
> news:522F9B5D-D648-4D7B-99F1-58EAB1B33923@.microsoft.com...
>> John,
>> The nature from a dataset is to work ofline, it is build for that.
>> When you do an update, there is looked if there has been a change (this
>> is called optimistic concurrency). The way as the data is organised makes
>> that the chanch for that is low or high.
>> By instance as you are adding and subtrackting values from tablerows,
>> instead of adding mutation rows, then you can probably forget it.
>> Cor
>|||Bill,
I disagree this with you, for extra database you need replication, with a
dataset you just needs common updates. The logical problems stays exactly
the same.
The serialization is completely automaticaly done by Dataset.ReadXML(...)
and Dataset.WriteXML(...), you write it as if this is a problem.
Cor|||Cor, you missed the point. Replication in this case is used for data
sharing--not just data persistence.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Cor Ligthert[MVP]" <notmyfirstname@.planet.nl> wrote in message
news:C859F647-3DB1-404A-AC9E-10213DDFA7AC@.microsoft.com...
> Bill,
> I disagree this with you, for extra database you need replication, with a
> dataset you just needs common updates. The logical problems stays exactly
> the same.
> The serialization is completely automaticaly done by Dataset.ReadXML(...)
> and Dataset.WriteXML(...), you write it as if this is a problem.
> Cor|||> Cor, you missed the point. Replication in this case is used for data
> sharing--not just data persistence.
I did not miss that Bill, however why would you do that if there are now
simple methods possible in ADONET and not only replication. Using a dataset
is in my idea much easier to handle conflicts by your own program.
Cor

No comments:

Post a Comment