473,804 Members | 3,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sql Database connection

73 New Member
I am trying to connect to a database with an asp.net page I am using a sql datasource control that has been supplied with visual studio. The Connection string is being stored in the web config file. The error that I am getting is after I have deployed the project and during runtime.

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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): 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)]
System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion exception, Boolean breakConnection ) +734963
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct stateObj) +188
System.Data.Sql Client.TdsParse r.Connect(Boole an& useFailoverPart ner, Boolean& failoverDemandD one, String host, String failoverPartner , String protocol, SqlInternalConn ectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert , Boolean integratedSecur ity, SqlConnection owningObject, Boolean aliasLookup) +820
System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword, Boolean redirectedUserI nstance) +628
System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance) +170
System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection owningConnectio n) +359
System.Data.Pro viderBase.DbCon nectionFactory. CreateNonPooled Connection(DbCo nnection owningConnectio n, DbConnectionPoo lGroup poolGroup) +27
System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection owningConnectio n) +47
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection outerConnection , DbConnectionFac tory connectionFacto ry) +105
System.Data.Sql Client.SqlConne ction.Open() +111
System.Data.Com mon.DbDataAdapt er.FillInternal (DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.W ebControls.SqlD ataSourceView.E xecuteSelect(Da taSourceSelectA rguments arguments) +1770
System.Web.UI.D ataSourceView.S elect(DataSourc eSelectArgument s arguments, DataSourceViewS electCallback callback) +17
DevExpress.Web. ASPxClasses.Int ernal.DataHelpe r.PerformSelect () +190
DevExpress.Web. ASPxClasses.Int ernal.DataConta iner.PerformSel ect() +118
DevExpress.Web. ASPxClasses.ASP xDataWebControl Base.DataBindCo re() +15
DevExpress.Web. ASPxClasses.ASP xDataWebControl Base.DataBind() +108
DevExpress.Web. ASPxClasses.Int ernal.DataHelpe rBase.EnsureDat aBound(Boolean ensureChildCont rols) +89
DevExpress.Web. ASPxClasses.Int ernal.DataConta iner.EnsureData Bound() +128
DevExpress.Web. ASPxDataView.AS PxDataViewBase. CreateChildCont rols() +15
System.Web.UI.C ontrol.EnsureCh ildControls() +87
DevExpress.Web. ASPxClasses.ASP xWebControlBase .EnsureChildCon trols() +4
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +41
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1360
Jan 18 '08 #1
1 935
radcaesar
759 Recognized Expert Contributor
You have to enable the remote connections in SQL Server 2005.

GO TO SqlServer Surface Area Configuration

Select, SqlServer Surface Area Configuration for services and connections

In The Remote Connections, Select Local and remote.

Now try to access ur SQL Server from another client PC's Management Studio.

Thats it.
Jan 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2413
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50 visitors to my Web site can access my database through my Web site at one time? Or does this mean that in my code I can only use 50 connections? and like
11
2441
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a database through Connection.open() method, and I do not use Connection.close() method, will garbage collector collect the connection object just because i am not using it any more. 2) I am using a dataset, in which i make some modifications to the...
3
2480
by: R Reyes | last post by:
Hi, I'm trying to modularize my database connections a little better and get more out of my project with less code. First check out this common dbOpen() function inside class clsDatabase. I removed the try/catch part as it is not important for my question: // This function opens a connection to the database. public static SqlConnection dbOpen() { // Create a SqlConnection object and pass in our connection string
14
4828
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same connection open all the time (as it's single user, this shouldn't be a problem). There is logic in the code to ensure that the connection is
7
2478
by: Lau Lei Cheong | last post by:
Hello, Actually I think I should have had asked it long before, but somehow I haven't. Here's the scenerio: Say we have a few pages in an ASP.NET project, each of them needs to connect to the database(Does not really matter but, in case you need to know, either MSSQL or ODBC ones) a few times when it loads to do the CURD things. How there's 3 ways proposed to do so:
3
10299
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database I use System.Data.Common.DBConnection and .DBCommand. How can I keep aware from connection losses (network not availeable, db-server not available...)? Are there any strategies to detect this broken connections, and how can I
35
4856
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection string in the web.config. I created a class with a static database connection and the class opens and closes the database.
6
3446
by: Arsalan Ahmad | last post by:
Hi all, I am creating a website in which in an Item detail page there are a number of web controls (7 or 8) and what is happening that inside each of control's Page_Load() function I am creating a database object to query data from database (using MySQL database). So it means that for each page request I am using 7 or 8 database connection which is something quite bad as far as performance is concerned. So please tell me how can change...
22
60297
Frinavale
by: Frinavale | last post by:
How To Use A Database In Your Program Many .NET solutions are database driven and so many of us often wonder how to access the database. To help you understand the answer to this question I've provided the following as a quick example of how to retrieve data from a database. In order to connect to a SQL Server Database using .NET you will need to import the System.Data.SqlClient package into your program. If you are not connecting to a...
1
27120
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts of using databases very well and is prerequisite reading for this article. Frinny’s article explains how to use a SQL Server in your program, but there are other databases as well. Some of them provide .NET connectors, but for those that don’t,...
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.