 |
| .NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 21st, 2007, 05:03 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Remote Access to SQL Server Express
Hello,
I have a C# web service running in IIS on Vista that I'm trying to get to fetch some records using .NET remoting from SQL Server Express 2005.
I've gone into SQL Server Surface Area Configuration and enabled remote connections using TCP/IP and named pipes. I've also enabled the named pipes and TCP/IP protocols in SQL Server Configuration Manager. I can't start SQL Server Browser (the Start button is diabled), and I understand that doing so is optional anyway.
My code breakes at:
dataSet = (DataSet)DataPortal.Fetch("PubsServices,PubsServic es.AuthorService", this.txtau_id.Text);
I'm setting the connection string in Web Config with:
<appSettings>
<add key="Pubs" value="Data Source=.\SQLEXPRESS;Initial Catalog=pubs;Integrated Security=True"/>
</appSettings>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="SingleCall"
objectUri="DataPortal.rem"
type="csDataPortal.Server.DataPortal, csDataPortal" />
</service>
</application>
</system.runtime.remoting>
This is all Rockford Lhotka data portal stuff. Had it working fine with XP, IIS, a SQL Server 2000.
Anyone run into problems remote accessing SQL Server Express 2005 from IIS, especially on Vista. I don't have the full version of VS. Building DLLs with C# Express and referencing them in Visual Web Developer projects, so I can't step through the code with all the projects in one solution.
Error Message:
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)
Thanks,
Bob
|
|

December 21st, 2007, 05:17 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
I think you're got the wrong forum, this one is on Web Services, you're talking about SQL Server and .Net remoting.
Also, if you are using .Net remoting to talk to the server that has the sql server express installed on then you're not trying to connect remotely to the sql server at all, your connecting remotely to your .net code, and then locally to the sql server.
/- Sam Judson : Wrox Technical Editor -/
|
|

December 21st, 2007, 07:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Thanks Sam, but that was helpful...how??
"PubsServices.AuthorService" is a Web Service. So posting to the Wrox .Net Web Services forum made sense to me.
I have a web service hosted on IIS on my local machine. My client code calls methods of the web service via objetcs from the .NET System.Runtime.Remoting component. I'm activating a remote object on the server through the .NET remoting subsystem, which is why it made sense to me to talk about...remoting.
The web service calls SQL Server Express 2005, fetches a record, and returns it to the client. At least its supposed to. But I get an error message: "...this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections."
I was wondering if anyone can tell me how to get my web service to talk to SQL Server 2005. I'm kinda' new to the remoting gig, but notice that the internet is littered with people who are having the same issue and error message.
Perhaps I should have posted to the "How do I get a .NET Web Service on IIS running on Vista to fetch a record from SQL Server Express 2005 using the remoting subsystem" forum. I just didn't see it. Apologies.
Bob
|
|

December 21st, 2007, 07:58 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Sorry, I wasn't trying to be rude (although I still think this would be better on a SQL Server forum).
A quick google produced this post: http://blogs.msdn.com/sql_protocols/...23/558651.aspx
Have you tried everything on it?
Also, can you double check the cliconfg.exe tool has named pipes and TCP/ip enabled.
HTH
Sam
/- Sam Judson : Wrox Technical Editor -/
|
|

December 21st, 2007, 08:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Thanks Sam,
Apologies for being snotty. Up all night. Tried everything. Have another go tomorrow.
Bob
|
|

December 21st, 2007, 10:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
I apologize for cross posting, but got desperate with a n-tier app that didn't have a clear primary forum. Anyway, I have SQL Server Express configured correctly to recieve remote calls. My problem was that I only had my connection string in my remote web.config file; I needed the local and remote connection strings in my client app.config file as well. Once there, works like its 'sposed tooo.
The error I mentioned (which has gotten a lot of forum and blog attention) - "this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections" - may also be caused simply by the fact that a connection string isn't initilized.
Thanks again Sam for your reply.
Bob
|
|

December 21st, 2007, 10:50 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Glad you got it sorted.
/- Sam Judson : Wrox Technical Editor -/
|
|
 |