Showing posts with label app_data. Show all posts
Showing posts with label app_data. Show all posts

Wednesday, March 21, 2012

Create SQL Server developer version database in app_data folder

Hi

I am trying to create a sql server database in the app_data folder of visual studio 2005. It keeps telling me I need the express version. Can I not use the developer version

Thanks

By default installation, SQL Server 2005 Developer version stores its databases' files in places like this (in my computer):C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

The express version can save a data file in app_data folder to work with visual studio 2005 or VWD. You need different connection strings to access your database.

Here is a sample section of connection strings in a web.config file to access databases (developer version):

<connectionStrings>

<addname="MSDN_forumConnectionString"connectionString="Data Source=localhost;Initial Catalog=MSDN_forum;Integrated Security=True"

providerName="System.Data.SqlClient" />

<addname="NorthwindConnectionString"connectionString="Data Source=(local);Initial Catalog=Northwind;Integrated Security=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

|||

Hi

Thankyou for your response. I have no problem connecting to a sql server deveoper version . The problem I have is when I right click app_data foler and add new item & choose databse I get the following error

Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.

I dont want to use the Express version but the developer version. Hope this make it a bit more clear

Thanks

|||

Hi,

Just as Limno said, if you want to create your database in app_data folder of Visual Studio 2005, you have to install the SQL Server Express edition because other editions of SQL Server does not support attaching database files automatically at runtime.

Thanks.

|||

Many thanks for your answer. I have now installed sql server express

Thursday, March 8, 2012

Create new database by the help of app_data folder without sql server express

I am using sql server 2005 developer edition with service pack 1
I have uninstalled sql express.
How Could I create new database by the help of app_data folder without sql server express.
That is when i right click on app_data folder and try to make a new database it give me the following error.

Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId=49251

I don't want's to install sql server express and want's the functinality of creating a new database via App_Data folder.What Can do ?

You could do as the error message suggests, and install SQL Server Express 2005 or just not create a SQL Server Express database at all. Error messages don't lie (at least not most of the time).

Ryan

|||

In the interest of helping me through my learning curve, I think I understand the problem. Let me try to explain it, in the hope that if I'm wrong, someone can further enlighten me:

1. SQL Server is intended for 'Enterprise' use, complete with full security and all of the stuff that goes with Enterprise usage. All databases must be attached to an SQL Server instance and are subject to all of the controls that are imposed by that instance. You would use the Server Explorer or the management tools that come with SQL server to set up the database and make sure that it was attached to the server.

2. SQL Express is intended for small environments. Although it is similar to SQL Server, it is not subject to the same controls, nor can it support the same high volume usage. It is intended for use in a development environment, where an individual database can then be ported to SQL Server and for small applications that do not require an 'Enterprise' database solution. When you right click and create the database, you are actually creating a database that is not attached to an SQL Server instance. If you do this, then run SSME (the management tool for SQL Express), the database that you created is not displayed, unless you attach it.

They are different products for different purposes. It might be worth asking Microsoft to add functionality to create a database in SQL Server using the same type of process, but there are a lot of issues that go with that. Those issues do not exist in the typical SQL Express environment.

Hope this helps, and if I have made an error, hopefully someone will correct it, since I am still going through the learning curve - and it's a really steep one.

Regards,

Flavelle