4

I am in the midst of writing a small program (more to experiment with vs 2010 than anything else)

Despite being an experiment it has some practical use for our local athletics club.

My thought was to access the DB (currently online) to download the current members and store locally on a laptop (this is a MS sql table, used to power the club's website).

Take the laptop to the event (yes there ARE places that don't have internet coverage), add members to that days race (also a row from a sql table (though no changes would be made to this), record results (new records in 3rd table)

Once home, showered and within internet access again, upload/edit the tables as per the race results/member changes etc.

So I was thinking I'd do something like write xml files locally with the data, including a field to indicate changes etc?

If anyone can point me in a direction I would appreciate it...hell if anyone could tell me if this has a name, I'd appreciate it.

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
user349456
  • 321
  • 1
  • 3
  • 9
  • Welcome to Stack Overflow! "Whilst I am here..I am loving the MVC2 framework & would like to know if there's an equivalent for windows programs?" I've edited your question to remove that. Please ask it in a separate question. – Earlz May 25 '10 at 00:24
  • Please keep tags (C#) out of the title. – John Saunders May 25 '10 at 00:32
  • 1
    @John Saunders, Why is that? I like being able to see the tags in the RSS feeds. – Jay May 25 '10 at 00:37
  • 1
    @John I'd say it's optional and redundant but we all know redundant is sometimes a good thing :) – Earlz May 25 '10 at 00:40
  • @Jay: The consensus over on meta is to avoid redundancy and noise. – John Saunders May 25 '10 at 00:46
  • @Earlz: if you want tags in the feed, put in an enhancement request. Let's not use the title for tags just because feeds don't do what you'd like them to do. – John Saunders May 25 '10 at 00:46
  • @John, IC. I guess its unfortunate I wasn't part of these discussions. Btw, tags in the feed was my idea. – Jay May 25 '10 at 01:03
  • I agree that having C# in the title is useful. It's inconvenient to learn that the question is about C# only once you read the tags at the end. I agree that having all the tags bracketed in the title is redundant, but there are certain primary ones that are critical to see before reading the question. Can someone link to the discussion please? – user85509 May 25 '10 at 01:18
  • [Should language-specific questions contain the language name in the title?](http://meta.stackexchange.com/questions/19190/should-language-specific-questions-contain-the-language-name-in-the-title) – John Saunders May 25 '10 at 01:28
  • Also, what display are you looking at which only shows you the tags at the end? In both of the Questions views, you can see the tags before you even open the question. Interesting and Ignored tags can also prevent you from having to read through the wrong questions. It's not necessary to overload the use of the title line. – John Saunders May 25 '10 at 01:30
  • @John there are exceptions then according to that meta post. Anyway it's pretty irrelevant and I think we should stop talking about it on this question – Earlz May 25 '10 at 01:37

5 Answers5

4

Essentially what you need is, in addition to your remote data store, a local data store on your desktop. You could then write your code by hand to sync the data stores when you go offline / online, or you could use the Microsoft Sync framework to handle it for you.

I've personally used the Sync framework on a number of projects and once you get used to the conventions, it's pretty easy to use.

lomaxx
  • 104,787
  • 56
  • 140
  • 177
  • Yes use SQL Server compact edition on your laptop. see good example here http://keithelder.net/blog/archive/2007/09/23/Sync-Services-for-SQL-Server-Compact-Edition-3.5-in-Visual.aspx – Daveo May 25 '10 at 00:50
  • this is looking positive...I've downloaded as much as i think i can read ...for now THANKS! – user349456 May 25 '10 at 07:06
  • hmmmmmm OK I went abrowsing found a walkthrough on msdn (cc488233.aspx) however I have ended up with a local .sdf file and a dataset.xsd in my project. I was then going to access this via a repository, but fell in a heap when the linqtoSql failed. I really wanted to use linq for this (as it's a learning exercise) Is there a means? how do I reference this locally? Can I get all the great lazy loading ability (guess that's not such a concern on a local database?) – user349456 May 26 '10 at 04:38
1

If you're using MS SQL Server for production, and you only need to work offline on your personal computer, you could install MS SQL Server Express locally. The advantage here over using a different local datastore is that you can reuse your schema, stored procedures, etc. essentially only needing to change the connection string to your application (which you could run locally too through Visual Studio). You would have to write code to manually sync your online and offline db instances, but since it's a small application, it may be reasonable to just copy the entire database from production to local and then from local to production when you get home (assuming you're the only one updating the db, and wouldn't be potentially wiping out any new records entered in production while you were at the event).

Stephen Swensen
  • 21,731
  • 9
  • 76
  • 126
1

If a local storage format is what your after. SQLite is one option. You can copy your tables from the server to your local SQLite db.

You could also save your data to files, but XML is a horrible format for doing this. You'll probably want to use YAML or JSON instead.

Jay
  • 8,544
  • 6
  • 31
  • 38
1

You may want to take a look at SQL Server Compact -- it provides some decent capabilities with synchronizing back with the mothership SQL server.

Robaticus
  • 22,087
  • 5
  • 52
  • 63
  • Please provide a link if you're going to advertise something. We're too lazy to search. – Jay May 25 '10 at 01:13
  • Ok, I'll scratch my head on that comment, but to satisfy you: http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx – Robaticus May 25 '10 at 02:17
0

Google Gears http://gears.google.com/ is intended if your app is a web app (which I didn't quite get what it is from your description)

Kevin Le - Khnle
  • 9,509
  • 8
  • 46
  • 76