[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to use aspnetdb.mdf on my production server

Posted on 2014-09-01
6
Medium Priority
?
65 Views
Last Modified: 2015-09-01
HI,
I would like to protect some pages in my asp..net web site.

I tried with a very simple project with one default page, a login.aspx page and a protected folder( with one page).
Vs (express) created a aspnetdb.mdf file.

On my local environnement it works fine but when i try to move to my hosting solution (arvixe) , nothing is working anymore.
I guess the problem is when the login form try to read informations in the aspnetdb.mdf.
i add a connection string in my web.config but i am not sure it's the right way...

Someone could help me to solve the problem ?
0
Comment
Question by:Ok123
  • 4
  • 2
6 Comments
 
LVL 29

Expert Comment

by:Dan McFadden
ID: 40296302
A little more clarification is needed.  I assume you are using SQL Express and IIS?  Or are you using an Access database?

You can not just copy a *.mdf from 1 server to another.  For a direct copy, you first must detach the database from SQL Server (using SQL Server Management Studio), transfer the *.mdf file to the new server (which needs to have some form of SQL Server running), then attach the database and verify that the db is online.

Then, if your IIS is configured and running correctly, you should be in business.

Dan
0
 

Author Comment

by:Ok123
ID: 40296384
Hi ,
I am working with VS Studio 2012.
I am not working with access.
The aspnetdb.mdf is generated by vs when you add a login control in a asp.net login page.

The problem is to connect that db when i work on my production server.

Regards
0
 
LVL 29

Expert Comment

by:Dan McFadden
ID: 40296401
Then the question is, do you have an instance of SQL Server or SQL Express installed and running on the Prod server?

VSExpress installs SQL Express during its installation process, which is why you can use a SQL database on your local device.

1. download SQL Server Express with management tools (SSMS)
2. install it on your prod server
3. attach your database as noted above.

I would recommend first trying this on a replica of your production server.  I would verify all the software that is installed/running on your prod server before dropping a SQL engine on it.

Dan
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ok123
ID: 40296422
yes i have a sql server on the prod server.
It's an Arvixe shared hosting.
0
 
LVL 29

Expert Comment

by:Dan McFadden
ID: 40296467
So then, I would follow the steps mentioned above.  Do you have console access to the server?

Here is a link describing the concept of detaching/attaching a database file.:  http://technet.microsoft.com/en-us/library/ms190794(v=sql.110).aspx
And here is a link to connection strings for asp.net apps:  http://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx#sse

BTW:  "Arvixe shared hosting" doesn't mean anything.  It gives no context as to what you have on your production server.

Dan
0
 
LVL 29

Accepted Solution

by:
Dan McFadden earned 2000 total points
ID: 40311647
Any update?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question