Mvc database connection

Discussion in 'Databases' started by CreepBo, May 28, 2013.

  1. Hello I need your help!:(
    I can't seem to connect my mvc database with Winhost connection, the good news is I am an old Winhost user and i have did this quite a few time in the pass. but never with mvc, it work fine on my end. here is my connection below.

    <add name="DB_59102_secoffice" connectionString="Data Source=tcp:s09.Winhost.com;Initial Catalog=DB_59102_secoffice;User ID=DB_59102_secoffice_user;Password=******;Integrated Security=False;" providerName="System.Data.SqlClient"/>

    I am using the razor syntax, the data appear to be going somewhere on my end, but not going into my database where i want it to go. Thanks :)
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    What's the error message you're getting?
     
  3. the error message:
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

    No data shown in my database..
     
  4. Elshadriel

    Elshadriel Winhost Staff

    Double check the connection string. You usually get that error if you're trying to reference a SQL Server Express instance.
     
  5. how do i correct this problem.
     
  6. how do i correct this problem.
     
  7. Ray

    Ray

    You will need to go into your codes directly, typically it is in the applications web.config file, and recode the connection string to point to the Winhost SQL server and not a SQL Express database.
     
    Last edited by a moderator: Oct 14, 2015
  8. Elshadriel

    Elshadriel Winhost Staff

    Check your second connection string in your web.config file. It looks like you're using &quot instead of an actual double quote (").
     
  9. I have this same problem. My live code & database on the web works, but I can't access my DB through SSMS or while running code through Visual Studio....using the same connection string that is in the live code you are hosting.

    Nothing has changed on my computer.....

    What did YOU Change on your end?
     

Share This Page