Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using remote sql server for web apps

Author  Topic 

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-09-18 : 11:12:21
i am using remote sql server(LAN intranet)for web applications. i can run the web application using lolcahost:xxxx as part of the URL. but if i replace the lolcahost:xxxx with the server name. it will not run. it give some sql error..

please help..

Thanks
Krishna

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-18 : 13:40:31
do you mean something like this ?

http://localhost:58209/welcome/default.aspx

If, so thats the testing server of visual studio at runtime
Go to Top of Page

krishna_yess
Yak Posting Veteran

81 Posts

Posted - 2008-09-19 : 01:55:39
no,
i am getting error message like this.



Server Error in '/InventoryTool' Application.
--------------------------------------------------------------------------------

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
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: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:


Line 60: {
Line 61:
Line 62: Sqlcon.Open();
Line 63: string id = Request.QueryString["ID"];
Line 64: SqlCommand Sqlcmd = new SqlCommand("select * from SigningCards where id = '" + id + "'", Sqlcon);


Source File: c:\Inetpub\wwwroot\InventoryTool\SigningCardRequest.aspx.cs Line: 62

Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-19 : 05:09:58
did you enable remote connections using tcp/ip ?

also, line 63. I would advice you not to use the query string. I prefer to use the control.text value.

Line 64, dont use dynamic variables.
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2008-09-19 : 05:41:13
Yes remember that remote connection are not enabled as default with sql server 2005, try enabling them in the

SQL Server surface area configuration, then choose Surface area configuration for services and connections

see if that helps

**************************
Check Check and double check it's the safest way
Go to Top of Page
   

- Advertisement -