Click here to Skip to main content
15,922,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear,
Following Error occurs while trying to login the application deployed on hosting server, while on the other hand it works perfectly fine on the local machine.

Any help/guidance will be highly appreciated.
C#
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)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error: 


Line 72:             string type = cmd.ExecuteScalar().ToString();
Line 73: 
Line 74:             if (!Roles.RoleExists(type)) Roles.CreateRole(type);
Line 75:             if (!Roles.IsUserInRole(lgnUser.UserName, type)) Roles.AddUserToRole(lgnUser.UserName, type);
Posted
Updated 3-Dec-13 18:46pm
v3
Comments
VICK 4-Dec-13 0:41am    
Change your connection string on the hosting server.. perhaps you have deployed the application along with the local machine Sql connection string.
Thanks7872 4-Dec-13 0:45am    
If you don't know how to edit contents,don't edit it.
VICK 4-Dec-13 0:53am    
Rohan, I tried to show the Error in Red.. so that it could clear the reader(s) as it is error. and not the code.
this is as how I think..
Swinky_Talwar 4-Dec-13 0:43am    
no i had changed the connection string in web config file
Swinky_Talwar 4-Dec-13 6:18am    
jhagra mat kro koi solution nahi h kya

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900