Hello Friends, One of dotnetspider member raised a question on app_data in the forum, and that inspired me to write about this folder. I will explain why this folder resides in the web application. Its use and advantages.
Why App_Data folder: App_Data folder reside in web application’s root folder. It is a reserved folder and it is there so that we can save our web site specific data related files such as database files (e.g. MS SQL Server, MS Access). You can have nested folders inside App_Data to organize your database files. One web site project can have only one App_Data folder.
To add database to App_Data, right click on the folder and select required data file. It provides you list of all possible data files.
To add existing database files, simply copy paste the files in App_Data and refresh the folder or go through Add existing files after right clicking the folder. Be aware of adding MS SQL server database files. You need to detach the database files first and then copy to the folder and reattach them.
Advantage of having App_Data folder: 1. It can be used for maintaining Membership(http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx) and Roles managements(http://msdn.microsoft.com/en-us/library/5k850zwb.aspx) 2. If your web project is complicated enough like having *.cs and *.vb files, this folder will not get affected by that since it just saves your database files and to access database in all code behind files you can just use connection string of web.config file. 3. You can manage your database easily using server explorer
Thanks and Regards Sanjivani
|
| Author: PHANI HARSHITHA MADALA 14 Mar 2009 | Member Level: Diamond Points : 1 |
hi,
good article about app_code.
the links are usefull in getting more info
|
| Author: Sanjivani 15 Mar 2009 | Member Level: Gold Points : 1 |
Thank you greeny_1984 :)
~Sanjivani Pl rate the post if you like it...
|