0

I have created my site using ASP.NET Personal Starter Kits 3.5. I use Visual Studio 2008 only . .with its built-in SQL Server (2005 Express) ... my database in App_Data is ASPNETDB.MDF ...

I have created some of my tables also ....in ASPNETDB ..

In my local PC the site was running fine ...

But when I publish my site on production server it doesn't work and shows the following error

<!-- Web.Config Configuration File -->
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->
<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration> 

My hosting provider connection string ..

<add name="ConnectionString" connectionString="Data Source=69.16.253.19;Initial Catalog=usa_data;Persist Security Info=True;User Id=user;Password=pass" providerName="System.Data.SqlClient"/>

My hosting provider gave me the connection string to connect to the SQL Server 2005 but it doesn't work...

I don't understand why my site was running fine using the production SQL Server 2005 in my local PC when I include ASPNETDB.MDF file in App_Data in my local pc only ..if I remove file ASPNETDB.MDF from App_Data of my local pc ... the site stops working ...

Can anybody tell em how to fix this ... !! I am very tensed since last 3-4 days

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user583181
  • 75
  • 1
  • 5
  • 21
  • possible duplicate of [ A network-related or instance-specific error occurred while establishing a connection to SQL Server.](http://stackoverflow.com/questions/4736084/a-network-related-or-instance-specific-error-occurred-while-establishing-a-conne) – marc_s Jan 21 '11 at 21:28

2 Answers2

0

Firstly, the file in the APP_DATA folder is not accessible as a DB in production. You will have to migrate the whole Database from the ASPNETDB.MDF to the Production Database server (given by provider.) And then the site will work. Also, change the config to : to see the exact error!!

If the porting doesn't work, see the exact error and post it here.

manishKungwani
  • 925
  • 1
  • 12
  • 44
  • 1
    IS there any way to use ASPNETDB.MDF in Production server ? – user583181 Jan 22 '11 at 05:03
  • You will have to migrate the Database, i.e. generate a script and run it on the server. For SQL Server 2005, it is available as a task, when you right click on the database. – manishKungwani Jan 23 '11 at 12:35
  • You need to use the Database Publishing Wizard, right click on the mdf in VS and the option will be there. You will have to get some information from your hosting provider. –  Feb 08 '12 at 01:42
-1

make a backup of your ASPNETDB.MDF file an import it into your hosting after put this on your config file:

John
  • 1