[2005] How do I move my ASPNETDB.MDF to my website?
I have created a login page and applied some rules and every thing is working perfectly on my machine , now how can I move everything to my website ? do I upload my ASPNETDB.MDF to my website ? If so , how do I link my login pages to connect to the database ?
Re: [2005] How do I move my ASPNETDB.MDF to my website?
There is a folder called app_data created by VS when automatically or you can add it as manually. put your mdf file there and change your DB connection string to attach DB from file
Re: [2005] How do I move my ASPNETDB.MDF to my website?
And make sure your connection string is correct, and that it reflects what the new structure might be on the remote box.
Re: [2005] How do I move my ASPNETDB.MDF to my website?
Where do I place a connection string ? and what is the correct format ?
Re: [2005] How do I move my ASPNETDB.MDF to my website?
You can place it where ever you want. the "web.config" is a good idea (but make sure you encrypt it if it has the login info (password).
And there is no 1 connection string format, you can check this website for methods to build your connection string
Re: [2005] How do I move my ASPNETDB.MDF to my website?
Don't the web.config already do this automatically for you when you created the database anyways? The connection string should be in place in there already, and it is just a matter of re-configuring it to your remote server.
Re: [2005] How do I move my ASPNETDB.MDF to my website?
Quote:
Originally Posted by the_menace
Don't the web.config already do this automatically for you when you created the database anyways? The connection string should be in place in there already, and it is just a matter of re-configuring it to your remote server.
Only when using wizards
Re: [2005] How do I move my ASPNETDB.MDF to my website?
Sorry but I didn't get it ,
I already have a folder called App_Data , I uploaded this folder to my website , then what ?
I looked in to the web.config file and all I can see is this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<allow roles="Administrator" />
<deny users="?" />
</authorization>
</system.web>
</configuration>
do I need to add the connection string in between these lines and am all set ?
Oh and my webhosting company supports using (MS SQL Database) , is that the same as (Microsoft SQL Server 2005) ?
Re: [2005] How do I move my ASPNETDB.MDF to my website?
1- well, you have to ask.. MS SQL might mean SQL 2000 or SQL 2005 (which supports both)
2- The app_data must contain your DB .mdf file to work.
3- You need to change the connection string where ever you put it. and in your case it's not in the web.config. (even though putting it in the web.config would be a better idea)
Re: [2005] How do I move my ASPNETDB.MDF to my website?
You really should contact your host and ask them these details. They might have a different folder just for MDFs and you'll need to change your connection string to reflect that.