I’m having problem with my web.conf file. This file work fine on the local server without any problem at all whatsoever. My site can handle files, forms, upload pictures and users could login without a problem on the local server.
However, when I upload the web.conf to the remote server and access the page online through the Internet, I cannot login as an user and the page is displaying errors. The following is the error that the page is displaying:
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)
According to you there is a problem. May you please highlight what is wrong and then write it the way that it should be. Please provide the wrong code and the corrected one.
It is more than obvious that I'm not going to display all my connection and database private information online for the entire world to see it. I'm not that stupid. Would you do that? Whenever there is sensitive data to display the word "Fake" was typed
instead. Does it make sense?
I do have the right connection data and numbers but nobody should know that only me. If there is an error anywhere on the file, you should be able to spot it without the sensitive data.
It is more than obvious that I'm not going to display all my connection and database private information online for the entire world to see it. I'm not that stupid. Would you do that? Whenever there is sensitive data to display the word "Fake" was typed
instead. Does it make sense?
I do have the right connection data and numbers but nobody should know that only me. If there is an error anywhere on the file, you should be able to spot it without the sensitive data.
Thanks for your help
On don't be snarky... The error message is very clear, A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server name and/or credentials are incorrect. Correct server name and/or credentials.
Also look for hard coded connection stings in your code.
You can always use Visual Studio's Server Explorer or SQL Server Object Explorer" to
connection to the SQL server using a GUI then copy the connection string form the
properties windows. This should fix any typos.
That is the reason for what I'm very curious about this case since my website host reply to me with the following information:
"Your connection string is correct, we have tested it. The reason your application shows this error is not due to incorrect credentials or information in the connection string. There are also no issues with the SQL service to which you are connecting. Thus
the problem needs to be investigated further on the application."
So, it is clear that is not my connection or credentials
No snarky at all, you sound like you want me to display all my sensitive data and private connection information online.
That is the reason for what I'm very curious about this case since my website host reply to me with the following information:
"Your connection string is correct, we have tested it. The reason your application shows this error is not due to incorrect credentials or information in the connection string. There are also no issues with the SQL service to which you are connecting. Thus
the problem needs to be investigated further on the application."
So, it is clear that is not my connection or credentials
No snarky at all, you sound like you want me to display all my sensitive data and private connection information online.
Thanks
I don't care to know your DB or credentials. The errors is extraordinarily clear. Your code, wherever that may be, is trying to make a connections to SQL server but the connection is wrong. If the connection string in the web.config is correct, then
you might have a hard coded string somewhere in the code. Use Visual Studio's search feature to find the the incorrect connection data. Use the Server/Instance used in the error message.
Use Visual Studio's "Server Explorer" or "SQL Server Object Explorer" to connection to the SQL server using the wizard. Copy the connection string form the properties windows to make sure you do not have any typos.
Member
57 Points
373 Posts
Need help with web.conf file
Jul 29, 2020 07:11 PM|vstorpedo|LINK
Hello to all
I’m having problem with my web.conf file. This file work fine on the local server without any problem at all whatsoever. My site can handle files, forms, upload pictures and users could login without a problem on the local server.
However, when I upload the web.conf to the remote server and access the page online through the Internet, I cannot login as an user and the page is displaying errors. The following is the error that the page is displaying:
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)
Here is the code in my web.conf file:
Please I need help with this, thanks to all.
All-Star
53001 Points
23587 Posts
Re: Need help with web.conf file
Jul 29, 2020 07:19 PM|mgebhard|LINK
The error is pretty clear. The connection string is incorrect.
Member
57 Points
373 Posts
Re: Need help with web.conf file
Jul 29, 2020 07:24 PM|vstorpedo|LINK
Ok, thanks for your help
According to you there is a problem. May you please highlight what is wrong and then write it the way that it should be. Please provide the wrong code and the corrected one.
Thanks again for your help
All-Star
53001 Points
23587 Posts
Re: Need help with web.conf file
Jul 29, 2020 08:00 PM|mgebhard|LINK
I do not know your server name or login credentials. You are supposed to know that information.
Member
57 Points
373 Posts
Re: Need help with web.conf file
Jul 29, 2020 08:13 PM|vstorpedo|LINK
It is more than obvious that I'm not going to display all my connection and database private information online for the entire world to see it. I'm not that stupid. Would you do that? Whenever there is sensitive data to display the word "Fake" was typed instead. Does it make sense?
I do have the right connection data and numbers but nobody should know that only me. If there is an error anywhere on the file, you should be able to spot it without the sensitive data.
Thanks for your help
All-Star
53001 Points
23587 Posts
Re: Need help with web.conf file
Jul 29, 2020 08:31 PM|mgebhard|LINK
On don't be snarky... The error message is very clear, A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server name and/or credentials are incorrect. Correct server name and/or credentials. Also look for hard coded connection stings in your code.
You can always use Visual Studio's Server Explorer or SQL Server Object Explorer" to connection to the SQL server using a GUI then copy the connection string form the properties windows. This should fix any typos.
Member
57 Points
373 Posts
Re: Need help with web.conf file
Jul 29, 2020 08:44 PM|vstorpedo|LINK
That is the reason for what I'm very curious about this case since my website host reply to me with the following information:
"Your connection string is correct, we have tested it. The reason your application shows this error is not due to incorrect credentials or information in the connection string. There are also no issues with the SQL service to which you are connecting. Thus the problem needs to be investigated further on the application."
So, it is clear that is not my connection or credentials
No snarky at all, you sound like you want me to display all my sensitive data and private connection information online.
Thanks
All-Star
53001 Points
23587 Posts
Re: Need help with web.conf file
Jul 29, 2020 09:40 PM|mgebhard|LINK
I don't care to know your DB or credentials. The errors is extraordinarily clear. Your code, wherever that may be, is trying to make a connections to SQL server but the connection is wrong. If the connection string in the web.config is correct, then you might have a hard coded string somewhere in the code. Use Visual Studio's search feature to find the the incorrect connection data. Use the Server/Instance used in the error message.
Use Visual Studio's "Server Explorer" or "SQL Server Object Explorer" to connection to the SQL server using the wizard. Copy the connection string form the properties windows to make sure you do not have any typos.
Member
57 Points
373 Posts
Re: Need help with web.conf file
Jul 31, 2020 05:10 PM|vstorpedo|LINK
I solved the problem, it was not in the connection at all but in the <membership > and in the <roleManager >. Thanks to all