-1

Until now all of my questions creating the program itself [C# Winforms] have been answered by searching the SO database. It's been an immense help really. But now i'm through with my program and I want to know what sort of procedure comes after; what is involved in the migration to an operating sql server. I built my program with [Visual Studio 2013] to operate temporarily on a LocalDb for testing purposes. I noticed that nothing gets saved whenever I close the application, which actually saves alot of time during several test runs, but now I want it to save permanently on the published software system.

I've researched this topic abit and this is what i've come up with so far:

  1. I would first setup the connectionstring to work with my sql server (MSSQLSERVEREXPRESS 2012/2014)

  2. Publish my program. (For this I have prepared an install shield wizard. is this preferrable over a ClickOnce application?)

  3. Run and prep the Sqlservice (No idea how to do this... I know, I know... but I'm really only fluent in the coding department)

  4. Based on what I read, I would want to attach my database (.mdf service based database) through SQL management studio.

  5. ?? I'm not sure what happens after five.

Am I correct in these assumptions?

A) Would the program run just as simply as the LocalDb variant?
B) Would I finally be able to create permanent records?
C) Would the Sqlservice have to be ran each time, alongside the program?
D) What am I not seeing? What procedure am I missing?

All forms of help are appreciated. Do note that I have researched lightly about the topic, and have so far only come up with the idea to attach the Mdf to the server through SSManagementStudio and the rest is magic (so to speak).

Honestly, I know too little about sql server that I might not even be running on LocalDB, as I've read on another thread that I was merely working with Visual studio's SSData Tools (I've never consciously ran an SqlServer during the course of creating my program). But for the record, localDB is written on my connectionstring.

Avan
  • 223
  • 3
  • 13
  • 1
    Oh and for additional clarity: My program runs on C# winforms, I created a service based database and have so far been using SQL commands to write into the temporary tables. There are no errors in the existing code, but I'd like to know if the structure of the entire project might require changing in order to migrate to production. – Avan Mar 15 '16 at 16:33
  • 1
    LocalDB is perfectly capable to store data and keep it between runs of your program. If you don't need data sharing between multiple machine then you don't need to install the full Sql Server – Steve Mar 15 '16 at 16:35
  • 1
    Oh, seriously? I thought this was only capable with SQL Compact Edition/Sqlite. Is the fact that my program refuses to save data during debug runs, only due to the fact that it's ... well... debugging? and not something I will encounter once published? @Steve – Avan Mar 15 '16 at 16:38
  • 1
    This is the usual cause of your debug problem https://stackoverflow.com/questions/17147249/why-saving-changes-to-a-database-fails/17147460#17147460 – Steve Mar 15 '16 at 16:41
  • I just read the thread and it's mindblowing in simplicity. Now I haven't tried it, but it looks like just what I needed to hear. I'll post back later if I get any results, but first, a few questions. I've read around that ServiceBased databases (Mdf's) require an sql service in order to process (and save) data. A database that doesn't require this service would be the Compact .SDF's of VS 2010. Is the LocalDb we mentioned earlier an sql service, or a database? I'm just trying to make sense of the info right now, since the one you linked makes use of SQL Server Compact Edition 4. @Steve – Avan Mar 15 '16 at 16:53
  • Here you could find some useful info and links https://stackoverflow.com/questions/9655362/localdb-deployment-on-client-pc – Steve Mar 15 '16 at 16:55
  • This. This is even more clear than the last one. I'm surprised I couldn't find these through weeks of searching. I have a feeling the commenter* has the same problems I do, and it is extremely satisfying to know that I won't have to deal with SqlServer for the purposes of this project. Many thanks. @Steve – Avan Mar 15 '16 at 17:08
  • @Vendredi Please note that Stackoverflow is not a forum. If you have solved your problem, post an _answer_ instead of editing your question. – dandan78 Mar 16 '16 at 13:18
  • Will do! @dandan78 I'm still getting used to Stack Overflow and was fairly surprised when other users sent me Edit suggestions! May I ask where new users like me would be able to ask questions about the features of the site and it's use? Is there like... a subreddit for these things or Topic tag? – Avan Mar 16 '16 at 13:31
  • @Vendredi Well, you should probably read the docs first and ask if something remains unclear. There's the help center in the Help menu way in the upper right-hand corner of this page. I suggest taking the tour and then making your way through the rest. Then there is the meta site, which is where discussions of SO happen. – dandan78 Mar 16 '16 at 13:34

1 Answers1

0

The problem has been [Resolved]! FYI LocalDB is awesome and really isn't a hassle to deal with. I merely changed the COPY property below build options on the MDF file to Copy if Newer. Then I included everything I need into an InstallShield Wizard installer. Next problem came up was resolved by giving permission to use the MDF and LDF files to all users. I can now save permanent records. Thanks again Steve!

Avan
  • 223
  • 3
  • 13