Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

How to add database to asp.net project folder vs2012

A small asp.net c# application works with a remote database (on the same computer).

Question: What are the steps to upload this database to asp project folder?
0
Mike Eghtebas
Asked:
Mike Eghtebas
  • 3
  • 2
1 Solution
 
käµfm³d 👽Commented:
What do you mean by "remote database"? What kind of database is this?
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
It is in SSMS. I want to bring into solution folder as we do with desktop application (as local file).
0
 
käµfm³d 👽Commented:
SSMS is a utility for interacting with SQL Server and some of its lighter variants. It alone is not a database. Are you therefore saying that you are working with SQL Server? Or perhaps SQL Server Express or Compact?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
My apology for poor description. I have SQLEXPRESS12, the database I work with now is in the Data folder (C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS12\MSSQL\DATA) and this is how SSMS sees it.

I will not be using compact version. What I want to do is to upload this database from DATA folder (after it is off line and detached) into my asp solution folder.

The reason I am doing it to make this application portable. Later when I try it on another computer; which also has SQLEXPRESS12, would allow me to demo the app on that computer.
0
 
David Johnson, CD, MVPOwnerCommented:
take the database offline
copy it to your appdata folder
attach it from your appdata folder.
0
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
I can manually copy and paste it into App_Data folder manually. But I am looking for a wizard solution that it works.

I tried: On the solution folder right-click/Add/Existing Item...  this gives me the browser. After selecting the .mdf file, the database gets copied solution folder whereas I was expecting to put in App_Data folder which it doesn't.

Eventually, I want to add few tables and procs into a LINQ-TO-SQL interface to create a .dhml file to work with.

This process seemingly is different with asp compare to desktop which I am quite familiar with.

Question: How is this done in a asp.net application?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now