p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 11th, 2009, 12:16 PM
Authorized User
Points: 110, Level: 2
Points: 110, Level: 2 Points: 110, Level: 2 Points: 110, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2007
Location: Delhi, Delhi, India.
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
Default Remote Connection 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 11th, 2009, 02:06 PM
Friend of Wrox
Points: 6,570, Level: 34
Points: 6,570, Level: 34 Points: 6,570, Level: 34 Points: 6,570, Level: 34
Activity: 43%
Activity: 43% Activity: 43% Activity: 43%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,000
Thanks: 5
Thanked 37 Times in 36 Posts
Send a message via MSN to gbianchi
Default

Hello.

This is weird,
connection obj = new connection();
obj.connected();
obj.con.Open();
You are never telling obj what is the connection string!
__________________
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.
================================================== =========
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote connection error with SQL Server Express DudeBori82 SQL Server 2005 4 April 12th, 2009 02:51 AM
SQL Server remote connection error sterreyl ASP.NET 2.0 Basics 1 April 6th, 2007 08:17 PM
Bugbase SQL 2005 remote connection error dtcalif BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 January 12th, 2007 06:46 PM
SQLServerExpress not allow remote connection VictorVictor ASP.NET 2.0 Professional 21 October 24th, 2006 04:15 PM
Remote database connection tdaustin Classic ASP Databases 0 November 28th, 2005 11:28 PM



All times are GMT -4. The time now is 06:19 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc