-
Error:26 - Error Locating Server/Instance Specified
I am using
-MSSQL 2000
-Microsoft Visual Web Developer 2005 Express Edition
I have developed a very simple ASP pages, just trying to log in with one control and then it will call the next page. When I made connection to the server, I got the following error:
Provider SQL Network Interfaces, Error:26 - Error Locating Server/Instance Specified
the exception message is "An Error has occured while establishing a connection ot hte server. When connection to SQL Server 2005, this failure may be caused by the fact that under default settings SQL Server does not allow Remote Connections."
Here is a few things I have done and are needed to complete my questions.
- I don't have MSSQL 2005 in my machine
- I have set SQL Server Client Network Utility for TCP/IP and NamePipes
- I have changed connectinString setting in machine.config
- I tried to change connectionString in the web.config but error occured "unrecognized schema : ...."
I am running that web page from MSVD 2005 and not from IIS.
I couldn't solve this connection failure. Any suggestion would be much appreciated as I am just started to learn ASP.Net
Tks!
-
your connection string?
I would love to help, can you please paste your connection string that is most likely in your web.config or in your sqldatasource on the page?
it probably looks something like....
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;
of course, don't post your real username and password 
Sameer
-
Btw, that "unrecognized schema" error might come from a missing quotation mark or something (that's my guess). Can you please post your web.config ?
thanks
-
Hi,
Thanks a lot for your reply and sorry for my late reply as I was away last a couple of days.
<appSettings/>
<connectionStrings>
<add name="SGPOLY"
connectionString="data source=STAR;InitialCatalog=TEST;User Id=sa; password=pw" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<authentication mode="Windows"/>
</system.web>
I am just starting to learn ASP.NET and I would be appreciated if you can help me this problem.
Tks again.
-
I have one button in the ASP page and when it is clicked, the DB_Connection function will be called which is written inc file.
The function is as followed.
Public Sub DB_CONNECTION()
Dim htTemp as hashtable = Session("userInfo")
DB_USERID = "sa"
DB_PASSWORD = "pw"
DB_SERVER = "TEST"
DB_NAME = "**"
DB_CONNECT_STRING = "server=" & DB_SERVER & ";uid=" & DB_USERID & ";pwd=" & DB_PASSWORD & ";database=" & DB_NAME
Try
sqlConn = New SqlConnection(DB_CONNECT_STRING)
sqlConn.Open()
Catch ex As Exception
errHandler(ex)
End Try
End Sub
tks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks