Default Page and MS SQL Problem

Discussion in 'General troubleshooting' started by electrojunks, May 25, 2012.

  1. I'm using visual web developer express for my website and I've uploaded everything to the root dir including my database file. When I go to my website, I get the default Winhost page, how do I change that to my default page (Home.aspx) ? I cannot use IIS 7 since my OS/laptop is not supported.

    The second problem I'm having is when I go to the website/defaulthomepage I get a compilation error due the sql database not being able to connect. I'm new to web deployment so I don't know the process that's involved in uploading and connecting to a database on an actual website. Do I create a new database file using Winhost website manager and configure the connection string in web.config? If so how would I do that? Everything works in Visual Web Developer, so I just need to know how to get it to work on Winhost.
     
    Last edited by a moderator: Oct 14, 2015

  2. http://www.iis.net/ConfigReference/system.webServer/defaultDocument

    Configuration Sample

    The following configuration example, when included in a Web.config file for a site or application, enables default documents for the site or application. It then adds the file name "Home.html" to the list of the site's or application's default documents.
    <configuration>
    <system.webServer>
    <defaultDocument enabled="true">
    <files>
    <add value="home.html" />
    </files>
    </defaultDocument>
    </system.webServer>
    </configuration>


    Exactly that. Create a new database from Winhost CP and restore your database to the live DB instance.
    SQl
    https://cp.Winhost.com/sites/mssqlmanager.aspx
    MySQL
    https://cp.Winhost.com/sites/mysql.aspx

    DB restore instruction
    http://support.Winhost.com/KB/a1050...2008-database-to-Winhost-sql-2008-server.aspx
    http://support.Winhost.com/KB/a1049/how-to-transfer-your-local-sql-database-to-Winhost.aspx
     
    Last edited by a moderator: Oct 14, 2015
  3. I'm still getting an error message due to the database not being able to connect after following the method from http://support.Winhost.com/KB/a1050...2008-database-to-Winhost-sql-2008-server.aspx and replacing the connection string to my config file. I have 2 connection strings the normal one that I used for my project and the localsqlserver one, I've replaced the connection strings in both and tried to connect to both the localsqlserver connection string and the one that I used and still could not connect. I am still getting compilation error where sqlconnection could not open. The specific error is "The ConnectionString property has not been initialized" and is at the line in my code for sqlcon.open().

    I am also having an issue where I have to refresh on my webpage to get it to load my default homepage.
     
    Last edited by a moderator: Oct 14, 2015
  4. Elshadriel

    Elshadriel Winhost Staff

  5. My code works fine in visual web developer, everything runs well when the database is on my computer. How do I connect to the database that I've just uploaded? Here is the connectionstrings in my config files (I'm using the first one in my codes):

    <add name="ASPNETDBConnectionString1" connectionString="Data Source=tcp:s06.Winhost.com;Initial Catalog=DB_42515_aspnetdb;User ID=DB_42515_aspnetdb_user;Password=******;Integrated Security=False;" providerName="System.Data.SqlClient"/>
    <add name="LocalSqlServer" connectionString="Data Source=tcp:s06.Winhost.com;Initial Catalog=DB_42515_aspnetdb;User ID=DB_42515_aspnetdb_user;Password=******;Integrated Security=False;" providerName="System.Data.SqlClient" />

    And how do I solve the issue where I have to refresh the page to get it to load my default page?
     
    Last edited by a moderator: Oct 14, 2015
  6. Elshadriel

    Elshadriel Winhost Staff

    The connection strings look fine in your web.config file, however, the error message you provided would indicate a problem with your code:

    Regarding this:

    You need to configure the Default Document as mentioned earlier:

    http://www.iis.net/ConfigReference/system.webServer/defaultDocument

    You can either modify the web.config file directly or use IIS7 Manager to connect to your site and use the Default Documents module to set your default page. For more information, please see these Knowledge Base articles:

    http://support.Winhost.com/KB/a628/using-the-microsoft-iis-70-manager.aspx
    http://support.Winhost.com/KB/a593/can-i-specify-the-default-document.aspx
     
    Last edited by a moderator: Oct 14, 2015
  7. I've manage to get pass the error after doing some searching online and adding these codes
    <clear />
    <remove name=”LocalSqlServer ” /> to my web.config file. Now I am getting a login failed error.

    Login failed for user 'DB_42515_aspnetdb_user'.

    It appears that it is connecting but not able to login. The connection string is straight from the ms sql manager on Winhost.
     
    Last edited by a moderator: Oct 14, 2015
  8. Elshadriel

    Elshadriel Winhost Staff

    Most likely the password is incorrect. You can change the password for the database in the Control Panel.
     
  9. The issue is resolved, thanks.
     

Share This Page