How to use aspnetdb.mdf on my production server

I would like to protect some pages in my 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 ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan McFaddenSystems EngineerCommented:
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.

Ok123Author Commented:
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 login page.

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

Dan McFaddenSystems EngineerCommented:
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.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ok123Author Commented:
yes i have a sql server on the prod server.
It's an Arvixe shared hosting.
Dan McFaddenSystems EngineerCommented:
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.:
And here is a link to connection strings for apps:

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

Dan McFaddenSystems EngineerCommented:
Any update?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.