Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
  #1 (permalink)  
Old April 11th, 2009, 11:17 AM
Authorized User
 
Join Date: Jul 2007
Location: Delhi, Delhi, India.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default Remote Connection Error: Named Pipes Provider error

Hello Friends

Error Desciption:
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)


Error says problem in remote connection...I have checked dozen of posts of net, giving remedies of remote connection, which is not helping my cause. I have followed each and every step of remote connection, the connection is already enabled. But still the problem persists. Friends please help. I have to submit my major project, all was done until this problem happened. Please solve my problem urgently, please. Some posts say there is a problem in connection string.

Here is the code:
public void connected()
{
con = new SqlConnection("data source=CR32; trusted_connection=yes; database=credit_scoring");
//con.Open();
}
public int login()
{
connection obj = new connection();
obj.connected();
obj.con.Open();
obj.cmd = new SqlCommand("proclogin",obj.con);
obj.cmd.CommandType = CommandType.StoredProcedure;
obj.cmd.Parameters.AddWithValue("acc",acc_no);
obj.cmd.Parameters.AddWithValue("pass",pass);
SqlParameter sp = new SqlParameter();
sp.ParameterName = "@count";
sp.DbType = DbType.Int32;
sp.Direction = ParameterDirection.Output;
obj.cmd.Parameters.Add(sp);
obj.cmd.ExecuteNonQuery();
int flag = Convert.ToInt32(sp.Value);
return flag;
}
Friends I have made a dll file and calling the class of this file to use the above two functions. I think the problem is in datasource, please tell me the appropriate remedy. I have tried of setting datasource as local, but still the problem persists.
  #2 (permalink)  
Old April 11th, 2009, 01:07 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Please don't cross post
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
hbansal (April 11th, 2009)
  #3 (permalink)  
Old April 11th, 2009, 02:36 PM
Authorized User
 
Join Date: Jul 2007
Location: Delhi, Delhi, India.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks Sir. Please solve my query, I will remember of not cross posting in future.
  #4 (permalink)  
Old April 11th, 2009, 05:11 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

I will not "solve" it. I will try to help solve it. Anyway, I already said something on the other thread.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
  #5 (permalink)  
Old April 12th, 2009, 01:36 AM
Authorized User
 
Join Date: Jul 2007
Location: Delhi, Delhi, India.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have seen that thread, the link mentioned doesn't exist. I have configured remote connection on my PC, but still the problem persists.
  #6 (permalink)  
Old April 12th, 2009, 09:51 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

My question was about this code:

connection obj = new connection();
obj.connected();
obj.con.Open();

This can't be working, there is no connection associated to obj.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Connection Error hbansal ASP.NET 2.0 Basics 1 April 11th, 2009 01:06 PM
SQL Server remote connection error sterreyl ASP.NET 2.0 Basics 1 April 6th, 2007 07:17 PM
Named Pipes Provider, error: 40 ipaine SQL Server 2000 1 November 14th, 2006 03:36 AM
Named Pipes bpe_xmind Visual C++ 0 February 5th, 2006 08:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.