I'm using SQL server Express 2008. In a VC# Console Application.
And Yes I used those commands before. The problem I'm having is when I use a SQL Server database file. The program gets all messaed up when it tries to read the database file. When your running the program it connects to the database in the debug folder. and when your in the IDE it looks and access the sql server database file in the root folder. I was told to just access SQL Server and use that instead of what I was trying to do before.
I always suggest connecting to the instance and not the actual file.
Did you add this database using the "Add New Item..." window? If so, the database file is a SQL Compact database.
If you did not add the database this way and you did install SQL Express, then you DO NOT attach the database file to the project. You connect to the service(instance), not to the file.
To answer your questions Yes. And it didn't matter how I set it up. I still had problems with 2 database files. The one in the root folder and the one in the debug folder. I added a new record into the database when I was running in debug mode. So the new record got added to the database file in the debug folder.
I just add this file into sql server 2008 express with the Management Studio and all I want to know is how to add some thing in my program to access sql server and not the database file. That way it will point only one file. And this should fix my problem.
I just didn't see any option to connect to it.
There's only 3 options to use.
1) Microsoft Access database
2) Microsoft SQL Server Compact 3.5
3) Microsoft SQL Server database File.