connect to sql db from VS 2010

Discussion in 'Site Programming, Development and Design' started by armando6036, Dec 29, 2010.

  1. I am new to programming. I was able to write a website in my computer, attach it to the db in my computer and test it, it works just fine. I want to upgrade and set up the website in Winhost. I added the sq db 2008 to the Winhost server. Uploaded the website from my computer for the Winhost server and I am able to open the website from any computer. I am not able to run the pages that have a connection to the database.
    I am doing all my programming through VS 2010 in VB.
    Can someone help me?

    Tell me how to program the database connection on my webpage to see the Winhost db instead of the db in my computer.

    In advance, Thank you very much.
    Armando V
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    It sounds like you need to setup the connection string.

    Try going into your Winhost control panel and go to MS SQL Manager under the Site Manager. From there you should see an example of your connection string. Make sure you type the correct db login and db password.

    Here is another example of how a connection string will look like in your web.config file.

    <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />
    </connectionStrings>

    Also, you will need to make sure you move your local database on your local computer to our SQL server. Try looking at this kb article.

    http://support.Winhost.com/KB/a771/how-do-i-generate-or-restore-a-backup-of-my-database.aspx
     
    Last edited by a moderator: Oct 14, 2015
  3. DB already on server

    I have already move the db to the server. I will program the connection string on my web.config file and hopefully that would work.

    :) Thanks.
     

Share This Page