0

I'm trying to upload my ASP.NET MVC project to my website, I managed to upload it via "Publish" option in Visual studio, and then, I opened a database on GoDaddy's website using Plesk ( both my host and the database is on GoDaddy ), and trying to change the web.config to that:

<add name="DefaultConnection" 
     connectionString="data source=HOSTIP;uid=DATABASEUSER;pwd=PASSWORD;database=DATABASENAME" 
     providerName="System.Data.SqlClient" />

and then I get this error:

[Win32Exception (0x80004005): The parameter is incorrect]

[SqlException (0x80131904): 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: 25 - Connection string is not valid)]

System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +357
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +79
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +201
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +156

I tried to find some more information on the internet related to this issue, but I also get the error: "[Win32Exception (0x80004005): The parameter is incorrect]", So perhaps the whole syntax of my add tag is wrong?

Dorki
  • 1,021
  • 2
  • 8
  • 23
  • 3
    *"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible." means that it's unable to make a connection to the server. Whatever "HOSTIP" is, it can't reach that. The connection string and the `add` tag look fine. If the XML were wrong, you'd get an error about that, first. – madreflection Sep 30 '19 at 20:42
  • @madreflection what's about the "the parameter is incorrect"? it's related to the "HOSTIP"? – Dorki Sep 30 '19 at 20:57
  • 2
    This is really a question for your hosting provider. – Sam Axe Sep 30 '19 at 20:58
  • I'm reasonably certain that's caused by the connection failure. – madreflection Sep 30 '19 at 20:58
  • You can check the validity of your connection string [here](https://www.connectionstrings.com/) – Sam Axe Sep 30 '19 at 20:59
  • @SamAxe I couldn't find MSSQL there – Dorki Sep 30 '19 at 21:03
  • Then you're beyond my level of help. – Sam Axe Sep 30 '19 at 21:04
  • It's called "SQL Server". – madreflection Sep 30 '19 at 21:04
  • Can we at least be assured that you have an IP address or server name -- not literally "HOSTIP" -- as the data source in the connection string? – madreflection Sep 30 '19 at 21:06
  • Yes, by the way from the website @SamAxe sent, I found another syntax for the add tag: And now when I'm using this syntax I get different error: [SqlException (0x80131904): Login failed for user USER] – Dorki Sep 30 '19 at 21:08
  • 1
    This is effectively the same because `server` is an alias for `data source`, `pwd` for `password`, and `uid` for `user id`. Anyway, this is something you need to work out with GoDaddy. They're providing a service and you're unable to connect to it. They have a help desk exactly for helping you with this. – madreflection Sep 30 '19 at 21:14
  • I'm using my server's IP, changed it from localhost. but as you said, I might need to ask GoDaddy for that concern. – Dorki Sep 30 '19 at 21:23

0 Answers0