Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search


Move SQL Server DB Out Of SQL Server And Into The App_Data Directory As An .mdf File?

I'm currently writing a website in ASP.NET MVC, and my database (which doesn't have any data in it yet, it only has the correct tables) uses SQL Server 2008, which I have installed on my development machine. I connect to the database out of my application by using the Server Explorer, followed by LINQ to SQL mapping.

Once I finish developing the site, I will move it over to my hosting service, which is a virtual hosting plan. I'm concerned about whether using the SQL Server setup that is currently working on my development machine will be hard to do on the production server, as I'll have to import all the database tables through the hosting control panel. I've noticed that it is possible to create a SQL Server database from inside Visual Studio. It is then stored in the App_Data directory.

Does it make sense to move my SQL Server DB out of SQL Server and into the App_Data directory as an .mdf file? If so, how can I move it? I believe this is called the Detach command, is it not? Are there any performance/security issues that can occur with a .mdf file like this? Would my intended setup work OK with a typical virtual hosting plan? I'm hoping that the .mdf database won't count against the limited number of SQL Server databases that can be created with my plan.

View 4 Replies (Posted: Apr 13 10 at 17:21)

Sponsored Links:

Related Forum Messages For ASP.NET category:
DataSource Controls :: LDF File Increasing When Move From SQL Server 2000 To SQL Server 2008
I have 5 GB data, when I move from SQL server 2000 to 2008 with Import and Export wizard, my LDF size is increased to 30 GB, Can I reduce my LDF file or move. In my one of the table contain around 20 Lakh data which i have normalized in 2008 and create 4 tables, so my data is entering in normalized form in 2008. But due to size by hard disk is full. I have used shrnik command but it reduce to only 1 GB.

Posted: Apr 02, 2010 06:04 AM

View 5 Replies!   View Related
SQL Server :: Cannot Add MDF File To App_data
I'm using VS 2008 web developer express and SQL Server 2008 express. I created a few dbs using management studio and then created an App_Data Folder in the Web Developer. However, I cannot add the DBs that i created to the App_data folder. I navigated to C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLDATA and tried to add the DB to the App_data folder. I get the following error:

"The File cannot be added because its being used by another process.

Posted: Sep 21, 2010 06:45 AM

View 1 Replies!   View Related
SQL Server :: Can't Create A .mdf File In App_Data
when i try to add a SQL databasein APP_DATA folder, show the error : Login failed for userMPC2Administrator

Posted: Feb 09, 2011 04:22 PM

View 11 Replies!   View Related
Get Directory App_Data In A Static Helper File?
What am I supposed to write as CategoryPath to get the file in the App_Data folder?

/// <summary>
/// Summary description for XMLHelper
/// </summary>
public static class XMLHelper
public static string CategoryPath = "App_Data/Categories.xml";
public static void InsertCategory(string categoryName, string moderator)
XElement cat = XElement.Load(CategoryPath);

Posted: Feb 6 10 at 1:34

View 1 Replies!   View Related
Move A File To A Directory?
i have a directory lets say called

c:1 and in it there is a file called "file.dat" now how can i call a move routine lets say on a button click and from the c: directory move "file.(1).dat" into c:1, if file.dat already exists in that directory .

so if i do a move aain from the root directory c: it wil put "file(2).dat" and so on ..

Posted: Mar 04, 2009 03:54 AM

View 2 Replies!   View Related
Web Forms :: Rename A File On Server And Move To Another Folder?
Our project is based on 1.1 framework using / as code behind, is it possible to rename a file in a folder and move it to another folder on server or will there be any permissions problem.

This is a webapplication hosted on a dedicated server, this server is managed by us.

Posted: Nov 04, 2009 08:01 PM

View 3 Replies!   View Related
Move Data From File To Sql Server Database Table?
I will have file one machine in excel format.And i have the website and database hosted on go daddy.I need to move data from that file to sql server database table.The machine will have internet on it all the time. Is there a way i can accomplish this?

Posted: Apr 28, 2009 06:02 PM

View 3 Replies!   View Related
How To Transfor Database Placed In The App_Data Folder To SQL Server Database File
I have a couple of database built in web developer 2008 expression. The database file is placed in App_Data folder. in this case I have SQL server Express Edition installed onmy computer. so I can veiw database using dataconnection.

However, I will deploy my website and using SQL server. In this case, how can I transfer my database in the App_Data to SQL server database?

Posted: Dec 09, 2009 06:38 PM

View 4 Replies!   View Related
SQL Server :: Retrieve Data From Database Into Label / Move Next And Move Back?

i want to get data from database of field Name and Gender, and then display it in Label name and gender. when i click save it move to next record and display name and gender that next record.

Posted: Jan 28, 2011 02:34 AM

View 3 Replies!   View Related
Can Upload File To Virtual Directory On Same Server As Web App
I have a web server with a web application and a website both on it (2 seperate entities within IIS7.0). The web application needs to be able to upload files to a virtual directory created within the same web server and the website needs to be able to view that virtual directory to be able to allow for downloading of those files.

This sounds really easy, but I cannot figure out how to do the upload and the download.


Virtual directory = own folder file structure (does not fall within either website/webapp structure)

Website - standard user for outside users.

Webapp - authentication requierd and only used by inside users.

Webapp users upload files to virtual directory Website users download files from virtual directory (i.e. open files)

Posted: Mar 11 at 23:00

View 1 Replies!   View Related
Saving Ntext Data From SQL Server To File Directory?
A variety of files (pdf, images, etc.) are stored in a ntext field on a MS SQL Server. I am not sure what type is in this field, other than it shows question marks and undefined characters, I am assuming they are binary type.

The script is supposed to iterate through the rows and extract and save these files to a temp directory. "filename" and "contenttype" are given, and "data" is whatever is in the ntext field.


This works, but the file should be saving to the server instead of popping up save-as dialog. I am not sure if there is a way to save the response to file.

Posted: Mar 15 10 at 17:50

View 1 Replies!   View Related
Web Forms :: Save File On DataBase Or On Directory On Server?
i believe That Saving Files In DataBase is good for Security Issue , But in My Scenario i didnt Care about Secrurity Issue,

i want to ask U guys which Better Save Files into DataBase or save it on Directory on Server, where This Issue Required:

1-(Reduce Load on Server and didnt affect server Memory).

2- Security not important.

if they have the same result i will move to DataBase Saving.

Posted: Apr 24, 2010 12:32 PM

View 3 Replies!   View Related
Is This Possible To Download Applications Dll File From Production Server's Bin Directory
Is this possible to download my application's dll file from production server's bin directory...

Posted: Jan 6 at 17:39

View 2 Replies!   View Related
Architecture :: Saving The File To The Database Or To A Directory On The Server?
Hi, im doing a web application to store some data about the software that our company uses.

when adding a new record the the software table which looks like this:

sw id, sw name, version, date, comments i need sometimes (its optional) to add a file maybe a .pdf or .jpg to that software record being added.

This file(.pdf or .jpg) its a prove that the software has been approved the the IT department. So heres my question is:

Which is the best way to accomplish this, saving the file to the database or to a directory on the server?

obviously when displaying the software details the user should be able to see that document clicking on a button or something like that.

Posted: Nov 25, 2009 07:28 PM

View 5 Replies!   View Related
Security :: Write File To Temp Directory On Server?
I have an ASP.Net (2.0) application on an intranet that impersonates the users Windows login.

It has <identity impersonate="true" /> in the web.config file.

In a couple of places it needs to create a file in the temp folder of the server (a text file in one instance and a Word doc in another instance) before sending the resulting file to the user, after which it is deleted.

It runs into a permission problem, which I assume is because the user that is being impersonated does not have permission to write to the server's hard drive.

How do I overcome this?

I assume it be something along the lines of temporarily running under a different account for the create/read/write/delete temp file parts of code.

how to do this and which account would be the best (easiest) to use. It will be a Windows 2003 server.

Posted: Mar 24, 2011 12:14 AM

View 3 Replies!   View Related
SQL Server :: Add Database To App_data?
i tried to add sql/server database file to app_data and i got this error

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)

im using sqlserver 2005 and VS2008 +i tried to amke remote cpnnection and restart the services but with no use

Posted: Jul 13, 2010 07:23 AM

View 2 Replies!   View Related
SQL Server :: Copying Database In App_Data?
I am currently developing a website currently in ASP.NET. I need to give the current ready website to another collaborator to continue with the work. But how do I send the database along with the website?

If this is done, what steps do I need to follow to use the database on the new machine? Do I need to change web.config or what more?

Posted: Jan 07, 2011 04:28 PM

View 3 Replies!   View Related
Visual Studio :: Add Sql Server Db To App_Data?
I've developed a site that uses a simple database with only one table.I designed th db in sql server 2005, and I use VS2008 as the IDE for site devlpmnt(VB.NET).The problem is that when I try to add the db file int the App_Data folder of my site by right clkg it and selecting 'Add Existing Item',it shows a message like this: "Connections to SQL Server files(*.mdf) requires SQL Server Express 2005 to function properly.Please verify the installation of the component or download from the [URL]

Posted: Dec 30, 2009 05:00 AM

View 2 Replies!   View Related
C# - How To Get The Current Project Directory Or The Bin Directory And Move A Few Level Up
I have an ASP.Net MVC app, and i have some xsl files inside of the Content directory.I've try a few methods to get directory dynamically buy keep on coming short.So how do i get the directory to point to the Content/xsl folder?the closest that i came to was with this:this.GetType().Assembly.CodeBase

which only returns the project DLL, but i can't figure out how to move up a few levels from there or what .net library to use to navigate around the path.there's no ../.. :(Basically i want to navigate to the Content/xsl folder which is at the same level of the Bin directory.

Posted: May 24 10 at 2:13

View 1 Replies!   View Related
Visual Studio :: Use Database File From SQL Server 2005 Installed In App Data Directory?
I am just learning application development and my question is so I can demo a project from an Internship for a class at school. I am planning on using Visual Studio 2010 in debug mode for the presentation.

Here it goes:

I created a database utilizing SQL server 2005. I want to take the .mdf file from SQL Server and place it in the App data directory of my application. I am hoping that I do not need to rebuild any datasets that I am currently utilizing. I am utilizing several stored procedures that are in the database, these stored procedure are access utilizing my datasets.

I was able to place the file in the application but I get an exception whenever I try to utilize a stored procedure that was created in the database.

Here is the error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I verified all of my datasets utilize the following connection:

<add name="DerrickConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename="|DataDirectory|Derrick.mdf";Integrated Security=True; Connect Timeout=30;User Instance=True "
providerName="System.Data.SqlClient" />

Get methods that I built with the query builder in VS work but stored procedures do not.

Posted: Dec 01, 2010 01:09 AM

View 4 Replies!   View Related
Move File From Client Side To Server Side?
To my understanding the clinet side can only send data to the server either by get or post. so basically either through query string (get) or through body of the page (post).

So when we upload a file from client machine and send it to server, what exactly is happening behind the scenes? are we doing a post?

Posted: Feb 18, 2010 01:05 PM

View 2 Replies!   View Related
App_Code - App_Data - Bin Directory Location
I am confused as to what to do with these. I have .cs files in App_Code. I also have other files in App_Data, and Bin. Could I just create these folders, make them virtual directories and upload my files as normal? Or do I need to do something special with these folders/files? Im really stuck on this. Also, this is a "shared hosting" account.

Posted: Jul 28, 2010 02:58 PM

View 5 Replies!   View Related
Deploy SQL Express In App_Data Directory?
Despite using many sql databases before, I've never actually tried to develop an app with a database in the App_Data directory.

It's a small WCF service project, which has a sql express 2008 r2 database.

Working in VS there are no problems, I thought it would be as easy as deploying to a server (win 2008 with sql 2008 r2 installed) and it would just work. But it would appear not.

In the web.config, the connection string which uses |Data Directory| in the connection string.

I read here that |Data Directory| only works in VS, but looking at other articles on the web that doesn't seem to be the case.

I have (for the sake of this) given everyone modify rights on the app_data dir on the server.

I deployed using the package feature in VS 2010.

Posted: Oct 18 10 at 14:02

View 1 Replies!   View Related
DataSource Controls :: Add A New Sql Server 2008 Database To App_Data Folder?
I was wondering if it is possible to add a new Sql Server 2008 Database to my App_Data folder in VS2008 SP1. I do have Sql Server 2008 Express edition installed.

Posted: Sep 04, 2008 12:02 PM

View 10 Replies!   View Related
Difference Between The Database Inside App_Data Folder Vs Connecting To SQL Server?
I'm new to .NET and while starting to learn ASP .NET MVC2 framework I see that you can create a .mdf file inside the App_Data folder and connect to it or you can connect to a SQL Server.What is the difference between these to methods of interacting with a database? What are the advantages/disadvantages of one over the other?

Posted: Oct 22 10 at 20:49

View 1 Replies!   View Related
Visual Studio :: Shared Hosting Account - Create A Folder And Default To Wwwroot Or Manually Move Webconfig And App_Data?
I have a shared hosting account where I can host multiple domains.I connected to the web from Visual Studio and there is a wwwroot directory [URL] I have to put the website under this folder.When you create a website under VS, it just puts the files in [URL], can I create a folder and default to wwwroot or can I manually move the webconfig and App_Data?

Posted: Dec 16, 2009 10:37 AM

View 1 Replies!   View Related
MVC :: Images In Content Directory / Internal Visual Studio Web Server Work Well But Not On Other IIS Server?
sorry for buther I'm a newbie in ASP.NEt MVC and I have some issue deploying my application on IIS, that use a logo image within my main master page declared as

<img src="../../Content/logo.bmp" alt="logo" />

When I use the internal visual studio web server work well but not on my other IIS Server.

What's the mean of ../../Content ? Is this directory deployed with particular rules?

Posted: Nov 11, 2010 02:35 PM

View 2 Replies!   View Related
Custom Server Controls :: Figure Out The Absolute Path To App_data Folder On Project?
I have an user control that reads the data from app_data folder and does some processing.In design time I'd like to show the row data in control placeholder (using GetDesignTimeHtml).To do that I need to figure out the absolute path to app_data folder on my project.The HttpContext is not available andHostingEnvironment.MapPath returns null.

Posted: Mar 31, 2011 02:12 PM

View 3 Replies!   View Related
Configuration :: App Runs But When Move It To The Server, Get This Error On Server: ERROR [42S02]
, I've researched this quite a bit and I'm just not seeing the problem. The app runs beautifullywhen living on my pc-the app on my pcconnectssuccessfullyto the SQL Server 2008 Express Database (which sits on a server - not my pc). However, as soon as I publish this application to the server that the SQL Server 2008 Express Database sits on, I get this error when I try to run the application:

ERROR [42S02][Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'user'

It's behaving as if it either doesn't know where the table is when the app tries to run on the same server as the database or maybe the app doesn't have permission to hit the database once the app is on the same server as the database. I have connections on my pc and the server defined for this database, I verified that I set up each connection the same. I've also tried connecting using [dbo].[user] and this doesn't remedy the situation connection string is in my web.config and it looks like this:

<add name="directoryConnectionString" connectionString="DSN=directoryProd" providerName="System.Data.Odbc" />

my sql looks like this:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

connectionstring="<%$ ConnectionStrings:directoryConnectionString%>"


SelectCommand="SELECT fName FROM [user]"></asp:SqlDataSource>

Posted: Apr 14, 2010 08:24 PM

View 1 Replies!   View Related
Move Files From Directory To Another Directory In C#
I have zip files in one directory . I want to iterate through all files and check the file size. If file size <>0 kb then want to move to another directory. How can I do that?

Posted: May 10, 2010 08:38 PM

View 6 Replies!   View Related
Visual Studio :: Working With Access In The App_Data Directory/Cannot Find Installable ISAM
I have an Access database which I created in the App_Data directory. I added the following to the Web.Config file:

<add name="LWAAccessConn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;DataSource==|DataDirectory|LWA.mdb;Persist Security Info=True" providerName="System.Data.OleDb"/>

I create the connection as follows (credit to [URL] for the following data access code):


At the "Conn.Open()" command I get the following error:

"Can not find installable ISAM".

I am sure I am missing something simple but do not know where to begin. I added a reference to System.Data to my project but that had not affect.

Posted: Oct 24, 2009 05:33 PM

View 2 Replies!   View Related
Want To Move Files To Server Through FTP
How is it possible to move files from a folder to web server through FTP, using ASP.Net with C# ?

Posted: Feb 13 10 at 8:32

View 1 Replies!   View Related
Move Application To A Web Server?
I have an ASP .net Web Application already deployed on my local machine (virtual directory/IIS are configured). I used the Publish tool from Visual Studio. Now I want to move it to our Webserver (I have the IP adress and the appropriate credentials).

EDIT By the way, I'm asking because I don't know if there is a specific way to do this? I can do it manually by moving the files to the remote computer and configure IIS approriately.

Posted: Jun 22 10 at 9:38

View 1 Replies!   View Related
DataSource Controls :: Importing Xml File Into Sql Server (.sdf) With Mapping File (Sql Server Compact Edition)?
I have been searching for some information on how to import my xml file into a series of tables using a mapping file (schema).

Posted: May 10, 2010 08:28 PM

View 2 Replies!   View Related
SQL Reporting :: Move Subscription To New Server?
In my live serverwehave total nos ofapprox200 reports and 50 email subscriptions created by us. Now we are planning to change our existing hardwareconfiguration and due to some other reasons, now the current live server we will not use in future, In view of same we wantto move our all our reports and email subscription toother new server and that new server will be our next live server.Nowtheproblem is that i have 50 email subscription whichi have created in old server so how cani movethis subscription to new server? Reports can be deployed to new server by taking the backup. Is there any other concern in such situtation?

Posted: Sep 23, 2010 09:30 AM

View 1 Replies!   View Related
SQL Server :: Move New Data To Other Database?
Wehave two database, one is normalised A other one is not normalised B. Bu SSIS mirroring we have moved all latest dataB to A. But now that is one time opersation. But B is our live database, now everyday I want that any operation occur in B should move to A.

Is there any automatic way is available if not then can I acheive this my manually?

Posted: Dec 28, 2010 01:39 AM

View 8 Replies!   View Related
SQL Server :: Not Able To Move Data To Database?
i'm tring to connect a ql database to my website but the data r not getting added in the table..
ut when i use the query builder there the data is been added successfully when done for testing the connection.i'm using sqlserver2005 in vs-2008.

Posted: Jan 04, 2011 05:59 AM

View 9 Replies!   View Related
Convert The Directory Path's To Urls - Remote Server Returned An Error: (500) Internal Server Error
I am testing a utility program that loops through my localhost and pulls out all of the meta tag information and page titles.After I do a recursive directory search and have all of the pages i convert the directory path's to urls and call the pages using the following code

WebClient wc = new WebClient(uri);
string page = wc.DownloadString(uri);

This seems to work fine for the first few sites, however at a certain point i start getting (The remote server returned an error: (500) Internal Server Error.). Nothing is wrong with the URI however it just seems to stop working at a certain point for no reason.

Posted: Aug 15, 2007 08:39 PM

View 2 Replies!   View Related
DataSource Controls :: How To Convert The Sql Server 2005 File To Sql Server 2008 File
I have a problem, I have created a website that is run on local host database is make in 2005 sql server

now i am using sql 2008 and visual studio 2010 , I attach the sql 2005 mdf file in sql 2008 server and run it working correctly when we host it then it is not working


how we can convert the sql 2005 mdf file to sql 2008 file.

Posted: May 24, 2010 01:12 PM

View 2 Replies!   View Related
Copyright 2005-08, All rights reserved