Click here to Skip to main content
13,004,094 members (108,939 online)
Rate this:
Please Sign up or sign in to vote.
I'm working out on creating membership schema in VS by reading this link,
In first step, it propose to create an database file in VS by adding a database file to App_data folder, and next I should open the MS SQL 2005 Express to determining that file.
I have MS SQL server 2008 R2, and when I want to add the database than I create in App_data,
I can't find it...
because The SQL server message : cannot access the specific path or file on the server. verfy that you have the necessary security privileges and the path or file exists.
How I can add that database?
can I create a database in MS SQL server and use it for this article?
if yes, How?
Posted 29-Oct-12 2:33am
Updated 29-Oct-12 3:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If this is for Sql server, then you shouldn't copy the file to you local folder - it should be where the SQL server instance can get hold of it - which may not be on the same machine as your local web site (or even have any access to you local web site machine). You should create the database in SQL server on the instance the web site will be using.

Alternativley, the easier way to do all this is to use an access database and follow this tutorial: Introduction to Membership[^] which take you through the process very quickly.
Z@db@khsh 29-Oct-12 9:11am
I don't want to copy a file in a folder, I create a database file in App_data, named SecurityTutorials.mdf, and when I want to determining this to SQL server 2008, that error prompt...
OriginalGriff 29-Oct-12 9:14am
You can't necessarily do that.
Most websites are hosted on a different machine from the one containing the SQL server instance - which means that the SQL server probably does not have any access to the hard drive you have put the file on.
Z@db@khsh 30-Oct-12 1:23am
I agree with you, but for this situation, what can I do?
in this article, can I design a database in SQL and follow the steps?
OriginalGriff 30-Oct-12 4:22am
Connect to your SQL server instance and construct the database there - you can do it in code (provided your SQL login has sufficient permissions)
If you construct it locally using the same version of SQL server, then have a look here:
You may be able to use similar code to restore it to your production server.
Otherwise, you will have to use SSMS to create a database copy via the SCRIPT command (right click the DB name, and follow the dialogs) - you can then use the script file to recreate the DB on the production server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 29 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100