473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

what is the app_data folder really for?

hi folks
I'm working on reverse engineering TheBeerHouse by Marco Bellinaso which
appears to have 100% unanimous approval on Amazon.
I got the book and downloaded the code and I opened the solution.
in his readme.txt he recommends that you move the database files he gives
you in the App_data folder (called oddly aspnet.mdf and aspnet_log.mdf) and
then attach them using sp_attach and rename them

I renamed these TheBeerHouse (mdf and ldf) and put them on another drive on
my XP prof machine and attached them to my SQL server 2005 (developer
edition) and I changed the connection string in web.config to reflect my
local settings.

everything works when I press F5, but my question is, what is the point of
app_data folder, it now has the non-attached original database that Bellinaso
provided in the download and I can't figure out a way to view the real data
on the SQL server through visual studio 2005 (but I can through the SQL
server management console). When I tried to add the now attached
TheBeerHouse.mdf file, I was informed that the file was in use (i.e by the
SQL server 2005 service)

should I have kept the database files in App_data and attached them to SQL
server from there? if not why would anyone ever use App_data, since SQL
server has its own data directory! I ask all this as an old C# asp.net 1.1
hand and am slightly baffled by the need for this data folder...
Regards and thanks in advance,
Charles
Sep 26 '06 #1
5 14341
App_Data allows you to use a file based SQL Server database (or Access, if
you like more pain ;->). If you are using an actual server, there is no
reason to have App_Data.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
"CharlesA" <Ch******@discussions.microsoft.comwrote in message
news:97**********************************@microsof t.com...
hi folks
I'm working on reverse engineering TheBeerHouse by Marco Bellinaso which
appears to have 100% unanimous approval on Amazon.
I got the book and downloaded the code and I opened the solution.
in his readme.txt he recommends that you move the database files he gives
you in the App_data folder (called oddly aspnet.mdf and aspnet_log.mdf)
and
then attach them using sp_attach and rename them

I renamed these TheBeerHouse (mdf and ldf) and put them on another drive
on
my XP prof machine and attached them to my SQL server 2005 (developer
edition) and I changed the connection string in web.config to reflect my
local settings.

everything works when I press F5, but my question is, what is the point of
app_data folder, it now has the non-attached original database that
Bellinaso
provided in the download and I can't figure out a way to view the real
data
on the SQL server through visual studio 2005 (but I can through the SQL
server management console). When I tried to add the now attached
TheBeerHouse.mdf file, I was informed that the file was in use (i.e by the
SQL server 2005 service)

should I have kept the database files in App_data and attached them to SQL
server from there? if not why would anyone ever use App_data, since SQL
server has its own data directory! I ask all this as an old C# asp.net 1.1
hand and am slightly baffled by the need for this data folder...
Regards and thanks in advance,
Charles


Sep 26 '06 #2
thanks Gregory, much appreciated!
Regards,
Charles
Sep 26 '06 #3
re:
what is the point of app_data folder
As Cowboy told you, App_Data allows you to use a file-based database.

That includes not only SQL Server 2005 and Access, but also XML files
and Excel worksheets, among others, i.e., *any* file-based data store.

The real advantage is that any file you place in APp_Data won't be downloadable
if a direct request for it is made over the wire, i.e., your data can't be hijacked.

The content in all the special ASP.NET folders other than
App_Themes is not be accessible via http requests to the server.

re:
should I have kept the database files in App_data and attached them to SQL server from there?
For SQL Server *.mdf files, it's not critical.
For other types of file-based data, it is.

re:
When I tried to add the now attached TheBeerHouse.mdf file,
I was informed that the file was in use (i.e by the SQL server 2005 service)
Just unattach them, move them to App_Data, and re-attach them.
You may need to stop the SQL Server 2005 dev edition service, though.

re:
why would anyone ever use App_data, since SQL server has its own data directory
Maybe it's not so critical for SQL Server database files,
but you may need to use other file-based data, and be
sure that they won't be directly downloadable.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"CharlesA" <Ch******@discussions.microsoft.comwrote in message
news:97**********************************@microsof t.com...
hi folks
I'm working on reverse engineering TheBeerHouse by Marco Bellinaso which
appears to have 100% unanimous approval on Amazon.
I got the book and downloaded the code and I opened the solution.
in his readme.txt he recommends that you move the database files he gives
you in the App_data folder (called oddly aspnet.mdf and aspnet_log.mdf) and
then attach them using sp_attach and rename them

I renamed these TheBeerHouse (mdf and ldf) and put them on another drive on
my XP prof machine and attached them to my SQL server 2005 (developer
edition) and I changed the connection string in web.config to reflect my
local settings.

everything works when I press F5, but my question is, what is the point of
app_data folder, it now has the non-attached original database that Bellinaso
provided in the download and I can't figure out a way to view the real data
on the SQL server through visual studio 2005 (but I can through the SQL
server management console). When I tried to add the now attached
TheBeerHouse.mdf file, I was informed that the file was in use (i.e by the
SQL server 2005 service)

should I have kept the database files in App_data and attached them to SQL
server from there? if not why would anyone ever use App_data, since SQL
server has its own data directory! I ask all this as an old C# asp.net 1.1
hand and am slightly baffled by the need for this data folder...
Regards and thanks in advance,
Charles


Sep 26 '06 #4
thanks very much Juan, much appreciated...
Regards,
Charles
Sep 26 '06 #5

CharlesA;6853312 Wrote:
thanks very much Juan, much appreciated...
Regards,
Charles
Dear Charles, you wrote that you have made the connection and
everything was working fine. Will you please give me some example code
how to connect to the mdf files placed in App_Data Folder.

Regards,
Imran
--
mimranm29
Feb 26 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hugo Flores | last post by:
I created a Web Application Project in VS 2005. The site is working fine in the development computer. Then I transfer all my files and dll to the production computer. I have a login form. If I try...
2
by: Artificer | last post by:
Why by simply having a .mdf file in the app_data folder it is made accessible? Does placing a .mdf in the app_data folder does some kind of attachment? Do this pseudo attachment works only with the...
2
by: Artificer | last post by:
Why by simply having a .mdf file in the app_data folder it is made accessible? Does placing a .mdf in the app_data folder does some kind of attachment? Do this pseudo attachment works only with the...
5
by: wwwmike | last post by:
I have an asp.net 2.0 application where I move about 200,000 text files daily in and out. When using VS 2005 to debug my application everything works find if only a few files are in the folder....
0
by: PinkBishop | last post by:
Question regarding the ASP.NET 2.O Membership / Role component The following works fine on local machine and networked dev box. ASP.NET Membership protecting files and folders. I am trying...
3
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
Is it always necessary to upload to the host, the App_Data folder if my db does not reside in that folder? -- L. A. Jones
12
by: Darrel | last post by:
I'm still having a hell of a time figuring out this whole SQL Express set up. I finally discovered why I couldn't run the aspnet_regsql...my local sql server wasn't running. I turned that on,...
1
by: =?Utf-8?B?U3VzaGlTZWFu?= | last post by:
I have problems with sharing files from this directory. It is system directory so I can't make dirrect links on files inside. For example /App_Data/my.mp3 www.example.com/App_Data/my.mp3 -...
2
by: Frank | last post by:
Hi, Originally I was planning to do some code reuse (yeah.. that exists..didn't want to believe it either) with some class library projects that I now want to use in a asp.net 2.0 web app in VS...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.