I’m building an application that automatically installs itself on a customer system, the app is being developed with WPF for the visual interface and I created a new Windows Forms App called Bussiness where I put all stuff related with the Data management, so I decided to create a LINQ to SQL Clasess, everything works fine on development stage, but when I build a Setup Project for my application I was confused about how to handle all things respect with the database and specifically with my LINQ to SQL configuration; because when I install the app on a “clean” computer, where the DataBase and the SQL Server is not installed, the app even starts ='(
So, please, help me. I have been investigating, some people says that my response is related with an .mdf file, but what I really want is that as part of my installation the database will be created on the computer.
Are you using SQL Server if yes it will be a pain to install this on every computer especially licence wise not sure if it’s legal.
If this database doesn’t need to be accessed from outside or by an another application you should use SQL Server Compact.
It’s an embedded version that is designed especially for desktop application for instance, and it you will be able to easily deploy it at the same time as you install the app.
here is more information : http://msdn.microsoft.com/en-us/data/ff687142.aspx
it will for sure work with LINQ to SQL, so code wise you will have nothing to change except the connection string.