Deploying a VB.net application with a .MDF file(sql server 2008) + ClickOnce
I am trying to deploy a VB.net application that is currently using SQL Server 2008 as its database to connect to.
I need 开发者_JS百科this application to be able to include a copy of its data so that wherever I install the application there is no need for them to install SQL Express.
What i have been reading is that I should of been using SQL Server Compact Edition to do this. Is there any way that I can do this with using an .MDF file?
If not, is it possible to convert an .MDF file to .SDF and then just include it in my vb.net app?
Thanks you
SQL Server CE is redistributable. SQL Server 2008 is not.
The level of dificulty changing to SQL Server CE will depend on things like have you used stored procedures (probably yes). It is not usually trivial.
But, SQL Server 2008 Express is redistributable and free, and apart from a few size restrictions is essentially the same as full blown SQL Server 2008. The notable restrictions are:
- 1 CPU socket
- 1 GB memory
- 10 GB of user data per database(R2 version) (was previously 4GB)
If there will be several instances of your application connecting to a central server then you should go with SQL Server 2008 Express. SQL Server CE is an in-memory, in-process database, Express runs as a stand alone service.
SQL CE can be deployed within your application directory with a zero pre-requisite footprint.
However, when moving from SQL Server you'll have to remember that you might miss out on a few of goodies that you may or may not be using (e.g. stored procs and some of the newer data types). Depending on your data access framework you will also need to change some architecture (e.g. Entity Framework requires a slightly modified SSDL).
In terms of creating a schema (and maybe some scripted data) from SQL Server (Express) to a SQL CE compatible script you might look at http://exportsqlce.codeplex.com/
精彩评论