Link to home
Start Free TrialLog in
Avatar of websss
websssFlag for Kenya

asked on

sql database with .net app - how

I'm an asp.net dev
Usually i put a DB in the APP_DATA folder or reference one in SQL server on win server 2008

I'm trying to figure out desktop apps
I need to create an all in one app that ideally doesn't need to be installed (just copy and paste folder)
Is this even possible?

What is the easiest way to create an app with integrated sql server 2008 db?

some instructions on exactly what to do would be helpful
thanks
Avatar of rgn2121
rgn2121
Flag of United States of America image

Is there a reason you couldn't use the express edition of sql server and have it installed with your app as a prereq?
Avatar of websss

ASKER

yeah i want to use express as its free
please bear with me, as i said i'm a asp.net dev, so new to the desktop scene

I'm not sure what you mean about having it installed with my app

Basically, i'm in visual studio 2010 and i need to add a database


each machine the app runs on will be stand alone with no network access
I will also need to do backups of each machine and import the data to my machine every day (manual process somehow)

based on this info, could you explan a bit more of what to do please
As rgn2121 suggested, you can install SQL express on each standalone desktop and do the manual process lateron or try implementing  MSAccess or SQLite (standalone db) as backend.

http://www.dreamincode.net/forums/topic/157830-using-sqlite-with-c%23/
There is a lot of info out there about this, but in its simplest form.  You code against the SQL Express Db and then when you create a setup and deployment project you can select sql express edition as a prereq.

Not sure how you are going to do the backups on remote machines with no network access.  You could create something that you could just go to each workstation and run and it would do the back, then go back to your machine and do the import...
Just as an added note, you can also get Mgmt Studio Express.  I have used this in past development projects...
http://www.microsoft.com/download/en/details.aspx?id=7593
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of websss

ASKER

Thanks James, that really clearly explains it for me

Just to clarify, i simply copy the SDF file, there is no backup/restore process?
Could i copy the whole directory (with app), and then copy it to a new machine and run it there?

Cheers
If SQL Server Express is installed on the "new machine" and the server has the same name, this should be enough.

If you do a standard install of SQL Server Express on your development computer and all the computers that use the application, the servers will have the same name. This is what Microsoft recommends for SQL Server deployment. But if for some reason you decide to give another name to the server on your development computer, you will ideally give the same name to the servers on all the computers. If the names don't match the one on which you made your development, the connection string that is created by Visual Studio when you create the local database won't work.