SQL Replication in C# mobile device application - mobile

I have a mobile application (CE) running on a Motorola Symbol 3090 which should allow for scanning of inventory items and changing their properties on our SQL server (The table has existed on the server for years and now they want a way to use mobile devices to update).
Here is the problem I am facing which needs addressing.
Our warehouse is very large and spans over multiple locations so inevitably we have dead zones in the warehouse so having a constant connection is not possible. What I have proposed is a way to go in offline mode and have an up to date copy of our inventory on local device. This would allow all transactions to be found and recorded locally. When the device is returned to cradle or back to wifi it updates the database. With this proposal i'm not sure if SQL Replication is the best way to handle this type of application.
Was hoping some more experienced mobile device developers had any input into the design scheme.
I have only been developing on these types of systems (Motorola symbol 3090) for about 2 months now and have no background knowledge in SQL Replication. I understand the basics of what replication is doing but that is about the extent of my knowledge on the subject.

As ErikEJ points out in the comment above, Merge Replication would work well for this scenario. Here are some resources to get you started:
MSDN's 'explanation'
Rob Tiffany's Book
Chris Fairbairn's blog
Erik's Library

Related

Is it possible to have an Access back-end database available for multiple users on the same network?

I am developing a Visual Basic .NET application to be used by the staff of a small training centre nearby. The front-end (UI, menus, etc.) will all be in VB .NET, and there will be a back-end database for storing all of the required data, such as student records and meeting information.
What I would like to know is if it's possible to use a Microsoft Access database for this purpose, and have it accessible by all the staff in the centre (on the same network) at the same time. For example, would I be able to put the database in a shared network folder, and have a copy of the VB application on each PC that would all be able to read/edit/add to the database?
Advice would be appreciated as to how I should proceed. (Note: I would really prefer a method of doing this with MS Access as opposed to suggestions to switch to SQL, as Access was the requested platform)
Thanks in advance.
Yes it can be done and from a programming stand point it is any (much) different then using SQL Server. I think the biggest considerations you have to think about are:
How many simultaneous users do you expect to have using the application?
How secure does the application need to be? Is Access security enough?
How big do I expect the database to become in the next 1 to 5 years?
I think those are you biggest considerations when using Access as a data store and if your answers fall within the specs of Access capabilities then go for it. You can always migrate to SQL Server at a later time if you run into the limits of Access.
You did not mention the version of Access that you are using but a quick Google/Bing search should return specs for every version available.
Yes, but probably not advisable. Despite the disclaimer in your post, you should try to convince the powers to be to look at SQL Server Express instead-- it's free.
But, if Access is the database, all you need to do is have the database reside on a shared directory with full read-write capabilities for all the users. Hopefully when you say "staff of a small training centre", you mean it.
Install the VB.Net program on the client computers and setup the connection string with the path to the database.
Someone else with more recent Microsoft Access experience can probably give better hints on how to reduce the corruption factor. My own experience was to stay away from queries in Access-- have the Access database only for tables and do all of your queries with SQL statements in your client code. My corrupted databases reduced dramatically when I did that, but that was 10-15 years ago.
Back up the database religiously.
Yes, just make sure you chane the extension of your back end access db to your_database_name.be_accdb and it will start logging once the user start writing to it. But I recommend SQL sever

Distributed Database Communication

I am a junior software engineer,I like this site and people in it.So,I want to ask my problems to see your answers and suggestions.Then,please don't mad at me for asking without searching.
My problem is about Distributed database communication(MSSQL Server 2008).In picture,I need a Main Server in center of star topology and other small servers that holding less data than center.Small servers job is normal web service with small database changes.On the other hand,Main Server should communicate with others periodicly(Once in hour,or twice in a day) and gather distrubited data changes in other small databases.
According to this plan,Main server is trustable,secured and backed up.Here is my question:
I plan to communicate on web services level.Main server should have a methods for controlling and checking databases.Is there any tools for this usage?I am looking forward to your suggestions,visions.
my kind regards and thanks in advance.
Take a look at SQL Server Replication. From the description you have provided, it sounds as though a solution using remote Subscribers that utilise Push updates could provide the functionality you require.
In the first instance, and in the interest of broadening your knowledge, I suggest you familiarise yourself with the varying flavours of solution that are available to you through SQL Server Replication technology and study their corresponding architectures.

Synchronising tables across remote Access databases

I'm helping out a business by providing an Access DB to manage requests of various types. As they are a construction company, they have one machine in an 'office' on the building site, plus 3 based in their main office. The machine on site has no internet connectivity.
Is there any (reasonably simple) way to synchronise the offsite and onsite databases every so often? I realise the tables could be merged, but each has an autoincrement field which must be synced between instances (i.e. when merging two tables the autoincrement should be reassigned based on the combination of records).
Cheers in advance,
Paul
Jet Replication is one answer, but not an easy one, as for a remote location you have to use indirect or Internet replication, both of which are pretty complex to set up and require regular maintenance to keep running reliably. That said, indirect replication works very well (I've never used Internet replication because of the hardwired dependency on IIS, which I consider unacceptable).
For one-stop shopping on the subject of Jet Replication, see the Jet Replication Wiki.
Microsoft is gradually phasing out support for Jet replication in Access (though I expect it to be supported as long as MDB files are supported without conversion), so a better solution to the problem might be to use the tools Microsoft has put in place to replace the functionality Jet replication provided. This would be Sharepoint, of course. In A2007, Sharepoint was way too inadequate to be a proper replacement for Jet replication, but starting with A2010 and Sharepoint 2010, all that changes.
If I had a new client coming to me with this requirement, even though I've got years and years of experience with Jet replication, I'd recommend A2010 and Sharepoint 2010 as the solution to the problem, and would say to wait.
It may be that a client doesn't want to spring for a Sharepoint server, and in that case, there's hosted Sharepoint available, which should be supporting Sharepoing 2010 shortly after the release of Office 2010 in May.
Of course, it's also possible to program synchronization manually, but that's quite complex in a multi-master scenario. However, if the records in the two databases do not overlap (i.e., records created in one are not updated in the other, or put another way, it's mostly and add-only app for each database), it's not as bad a problem. Deletes are a harder problem, but not unresolvable.
For your Autonumber PK field use a ReplicationID (GUID) instead of a long so that the numbers will be unique across all copies of the database, even if they are disconnected.
There are a lot of options for replication with Access. Here is an article to get you started.
Understanding Access Replication

Advantage Database or SQL Server

I have a client that currently uses a local Advantage Database on their PC along with an application. They are thinking of upscaling their setup to have multiple applications running communicating with a database server i.e/a client-server environment.
They are now considering the best database for this approach. They are looking at the Advantage Database Server product in comparison to SQL Server Express(the application does not warrant a full SQL Server at this stage).
Obviously SQL Server is a more well known product probably with more support but I was hoping you could give me some opinions and thoughts on what you think the best product would be in terms of performance, stability and support.
One thing to note although not directly relevant is that the application is currently written in Delphi and there could be a move to C# to bring it up to date.
The migration from a local Advantage Database to a client/server Advantage database is a very simple process. It simply involves changing the connection properties within the program. There are no other coding changes that need to be done.
Advantage has a great support team and has been in development for over 15 years. The stability and support are at least equal to SQL Server.
Advantage also provides a .NET Data Provider which would allow for C# development.
I have developed for both SQL Server and Advantage. They each have their pros and cons (although now I favor Advantage).
Given your situation, however, this decision appears to be a no-brainer: Advantage Database Server. Why? It's already done!
My Advantage programs run, unmodified, against the same database either locally or remotely. All I change is the connection string. I'm not saying that your customer's code won't have to be changed. I am saying it is likely to be trivial. Compare that to the greater effort involved in switching to a whole new database engine.
In general I'm a SQL Server person all the way. I work with id daily and have for almost ten years, but in your situatuion, it seems silly to consider moving to a new database when there is aclear upgrade path to do what you want using the backend you already have. It would be much less work and far less likely to introduce new bugs to stay within the same database family.
ADS wins hands down. It is maintenance-free. It is extremely reliable. It is extremely fast. It is extremely scalable. SQL is very well supported, and the ADS newsgroups are responsive (answers within hours instead of days on SQL server fora) and well-informed. I have been using ADS since 1991 and it has never gone wrong! My users are incredibly demanding and to be able to turn round solutions within hours instead of days, is both a joy to me and a business incentive to the end users and clients. Deployment is gentle, fast and simple. Platform support is better than SQL server. 64-bit server deployment abounds and is well-grounded, transparent and reliable. 64-bit clients are coming in the next version (10). My experience with ADS is wholly positive, whereas my ventures with SQL server have been fraught with difficulties, idiosyncrasies and workrounds!
I happen to be a support rep for Advantage so when you say "Obviously SQL Server is a more well known product probably with more support" I have to argue a bit.
As Chris stated switching from Advantage Local Server to the the Advantage Remote (client/server) Server is a pretty painless process - they designed it that way.
Install the Advantage Database Server on a machine where the data is located (not a requirement but it's recommended). You can get a free trial here: http://marketing.ianywhere.com/forms/ADS91-30-Day
Within the application there will be TAdsConnection component(s) - change the TAdsConnection.ConnectionType to 'REMOTE' (http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.1/mergedProjects/ade/sec7/connectiontype.htm)
You can specify the path (TAdsConnection.ConnectPath) from the clients in a couple different ways but the recommended is:
\\server:6262\mydata
http://devzone.advantagedatabase.com/dz/webhelp/Advantage9.1/mergedProjects/ade/sec7/connectpath_tadsconnection.htm
Note: 6262 is the port used by default (may need to add an exception to the firewall). Also if your application uses a data dictionary the path would include the name of the .ADD file (e.g. \\server:6262\mydata\mydd.add)
Hope this helps!

Firebird database replication

I have reached the point where I've decided to replace my custom-built replication system with a system that has been built by someone else, mainly for reliability purposes. Can anyone recommend any replication system that is worth it? Is FiBRE any good?
What I need might be a little away from a generic system, though. I have five departments with each having it's own copy of the database, and the master in a remote location. The departments all have sporadic internet connection, the master is always online. The data has to flow back and forth from the master, meaning that all departments need to be equal to the master (when internet connection is available), and to upload changes made during network outage that are later distributed to other departments by the master.
I have used CopyCat to create a replication project. It allows you create your own replication client/server configuration using CodeGear Delphi. This allows you complete flexibilty as to how you want your replication to work.
If you don't use Delphi, or need a prefabricated solution, CopyTiger does the same thing already configured.
I find IBReplicator by IBPhoenix to be the most complete, but there are many more listed here (with short descriptions):
http://www.firebirdfaq.org/faq249/
The Ibphoenix site list replication tools
IbPhoenix Replication Tools

Resources