.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Error while running on IIS

Posted By: R@j     Posted Date: December 12, 2008    Points:2   Category :Sql Server
Hi guys,

I was occured with the following error while running my website on IIS.can anyone plz tell me wat to do...

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Thank you in Advance

Responses
Author: Amit Mehra             
Posted Date: December 12, 2008     Points: 5   

Hi
you have enable the remote connection to your SQL Server. To do that follow these steps

1)Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.

2)On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.

3)On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

Note Click OK when you receive the following message:
Changes to Connection Settings will not take effect until you restart the Database Engine service.

4)On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 12, 2008     Points: 5   

Hi,

I have enabled the remote connections to sql server,still I got same error

Author: Amit Mehra             
Posted Date: December 12, 2008     Points: 5   

Hi Raja,
Did you restart the SQL Server engine? Because for that error thats the solution.

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 12, 2008     Points: 5   

Hi Amit Mehra,
Yes, I restarted the Server engine.Now I got the below error

"Cannot open database "Entertainment" requested by the login. The login failed.
Login failed for user 'RAJA\ASPNET'. "

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

Hi Raja,

Now check your connection string it seems your connection is wrong. or you can paste here so that we can figure out.

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 14, 2008     Points: 5   

Hi Amit,

This is my connection string.

"Data Source=RAJA\\SQLEXPRESS;Initial Catalog=Sample; Integrated Security=SSPI;"

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

Hi Raja,
if your connection string Data source is "RAJA\\SQLEXPRESS" then how come you are getting "Login failed for user 'RAJA\ASPNET'" error....I guess you will be getting different error Please post the exact error.

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 14, 2008     Points: 5   

Hi Amit,

I got this error only when requesting for database connection.

"Cannot open database "Entertainment" requested by the login. The login failed.
Login failed for user 'RAJA\ASPNET'. "

Author: R@j             
Posted Date: December 14, 2008     Points: 5   

Hi Amit,

I got this error only when requesting for database connection.

"Cannot open database "Entertainment" requested by the login. The login failed.
Login failed for user ''RAJA\ASPNET''. "


I may did wrong in publishing website on IIS.will u please tell the steps how to publish website on IIS.

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

Hi Raja,
change your connection string in this format and see

Data Source=yourServerAddress;Initial Catalog= YourDBName;User Id=YourDBUserName;Password=Yourpassword;

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 14, 2008     Points: 5   

Hi Amit,

Still got the same error

I may did wrong in publishing website on IIS.will u please tell the steps how to publish website on IIS.

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

Hi,

Your Database and Application is in the same machine?

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 14, 2008     Points: 5   

Hi Amit,

Still got the same error

I may did wrong in publishing website on IIS.will u please tell the steps how to publish website on IIS.

Author: R@j             
Posted Date: December 14, 2008     Points: 5   

yesmy database and application are in same machine

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

And whats your connection string? Exact connection string

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: R@j             
Posted Date: December 14, 2008     Points: 5   

yesmy database and application are in same machine

Author: R@j             
Posted Date: December 14, 2008     Points: 5   

This is my con string.Sample is my database.
"Data Source=RAJA\\SQLEXPRESS;Initial Catalog=Sample; Integrated Security=SSPI;"

Author: R@j             
Posted Date: December 14, 2008     Points: 5   

This is my con string.Sample is my database.
"Data Source=RAJA\\SQLEXPRESS;Initial Catalog=Sample; Integrated Security=SSPI;"

Author: R@j             
Posted Date: December 14, 2008     Points: 5   

This is my con string.Sample is my database.
"Data Source=RAJA\\SQLEXPRESS;Initial Catalog=Sample; Integrated Security=SSPI;"

Author: Amit Mehra             
Posted Date: December 14, 2008     Points: 5   

Hi Raja,
I strongly recommend you to change your connection in this format, please change your connection in this format and see the result


Data Source=yourServerAddress;Initial Catalog= YourDBName;User Id=YourDBUserName;Password=Yourpassword;


Thanks,
Amit
Please "Mark As Answer " if this post help you.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend