views:

63

answers:

5

New to .NET, any point in the right direction would be a huge help.

Trying to write a program to accept data input in a manufacturing environment and store it directly into a SQL database.

A problem I can foresee is if the Wireless Network Connection is interrupted (or temporary out of range)

Where would I research, or how would I go about, creating a local XML copy, or temporary Local XML file if the connection is not made back to the server?

Any suggestions or methods of doing this?

Thanks!

(I'm a VB programmer, but can figure out C# translation if needed)

A: 

Hi,

We had the same problem. What we did was to use a local database, you can do the same, for example using SQLLite it's a good idea. It's also feasible to store the data using XML.

Well, we did this, we have two separates threads:

i) a thread (A) that scans the source of the data (PLCs in our case) and puts the data in the temporary storage (in your case XML files).

ii) a thread (B) that scans the temporary data and sends it to the central database. The data sent to the central server can be either deleted or marked as sent.

This works very well. When (B) cannot connect to the server the data stars accumulating in the local database / xml. When the connection to the server is available again the data is sent properly.

tekBlues
A: 

Use NHibernate with two different data stores, one for remote, one for local. The problem comes with synchronization afterwards. You can iterate through the objects in the local database and make those changes to the master, and then delete them from the local database. Ideally after each connection, you should have zero data in the local database - unless that's part of your design, in which case your synchronization task just got more complex.

Chris Kaminski
A: 

Message Queueing might work for you http://code.msdn.microsoft.com/msmqpluswcf

You can write your messages to the queue and then have another process that reads from the queue and write to the database.

Matthew Whited
I have also used the IsolatedStorage before but Message Queues seem like a much better approach
Matthew Whited
+1  A: 

why don't you want to use Local Database caching mechanism? Walkthrough: Adding a Local Database Cache to an N-Tier Application

ArsenMkrt
Thanks everyone for the suggestions, probably a million ways to do it, but this seems to be exactly what I was looking for. Going to head in this direction (local database should work well, considering its usually a one-way transfer of data). Thanks.
JBickford
A: 

Here is where I would start: Smart Client Architecture and Design Guide

There is a Smart Client Application Block that can help you with some of the more difficult details. The Smart Client Application Block helps with syncing up local changes to the changes in a DB.

consultutah