I have created a database in Visual Studio 2005 by adding a new "SQL Database" item to my project, and then designing the tables with Server Explorer.
How can I add this database to my local instance of SQL Server Express, and to my SQL Server 2000 database engine?
You will find that the database has probably been created as a User Instance. The easy way to check this is to have a look at the app.config file, look for an Attach file string in the connection String. To add it to the SQL Express Engine you will need to attach it, this can be done through the command line or through the SQL Management Studio for Express (Or Full version). For information on the command line syntax for attaching the database I would have a look at the help or books online for Attaching Databases.
In regards to adding it to the SQL 2000 engine you might find that you will have to change the database structure as several functions will not work with the old engine. And in summary the only way to add it would be to strip out the DDL (Data Definition Language) scripts as well as the scripts to add the data and recreate the database.
|||Thank you for the response.
I'd like to ask a more general question. What is the best way to define databases within Visual Studio 2005, so that they will be part of my C# project and Source Safe version control? I guess what I'm looking for is sort of a "best practice" approach to developing my program and the associated databases together.
I will appreciate any information or MSDN references you can provide on this topic.
|||I do not know of any real best practices, But I do not stor e the Database files in Source Safe I use a seperate database project and only store the Data Definition Language for the database (SQL Scripts). I can then add the project to the solution and then to the VSS Project. I have had Problems in the past adding the MDF Files used by SQl Express in VSS so have chossen to follow the above procedures.
Hope this helps.
No comments:
Post a Comment