Re: SQL Network Interfaces, error: 26

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks a lot
"Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
news:OQVOUjf6IHA.1468@xxxxxxxxxxxxxxxxxxxxxxx
re:
!> "Data Source=.; also appears to work.

Indeed, because the dot ( . ) signifies the default instance.

re:
!> Will that use the default instance on any machine the code is loaded
on?

Yes, but remember that not all instances are default instances.
Some are *named* instances.

In the case of the SQL Express named instance ( Data Source=.\SQLExpress )
what happens is that SQLExpress is the default name used for its named
instance.

So, the dot ( . ) plus the default named instance, creates the full name
for the named instance.

For SQL Server 2000, it's the same.

You can use the dot for the default instance, which equates to the
machine's name,
but most installations create a named instance which needs to be added in
order to
get a fully qualified instance name.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"AAaron123" <aaaron123@xxxxxxxxxxxxxx> wrote in message
news:eON979e6IHA.3652@xxxxxxxxxxxxxxxxxxxxxxx
That works!

But now the code will only run on my machine (I assume).
"Data Source=.; also appears to work.
Will that use the default instance on any machine the code is loaded on?


How do people prepare code to work on multiple machines without hard
coding for the default instance?

Thanks


"Michael Nemtsev [MVP]" <nemtsev@xxxxxxx> wrote in message
news:900895ec559988cab8191cb9c5b0@xxxxxxxxxxxxxxxxxxxxxxx
Hello AAaron123,

Just specify you PC name in the connection string
instead of "Data Source=.\SQLExpress;
use "Data Source=YOUPCNAME;

---
WBR, Michael Nemtsev [Microsoft MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and
we miss it, but that it is too low and we reach it" (c) Michelangelo

A> "Michael Nemtsev [MVP]" <nemtsev@xxxxxxx> wrote in message
A> news:900895ec550718cab6e4394c81d0@xxxxxxxxxxxxxxxxxxxxxxx
A>
Hello AAaron123,

".\SQLExpress" means that you are connecting to SQL Express server.
It's
standard build-in name
If you want to connect to SQL Server (not express) you need to change
this
line on "(local)".
Btw, if you have SQL Management Studio installed (install if you not)
then you cant check which sevices you have and their names)

A> The default instance is unnamed and is shown as the computer name.
A> How do I reference that in the
A> connectionString="Data Source=
A> thanks for staying with me
A>
Alternatively, you can use Server tabs in visual studio and it shows
available SQL server around you. After u connect to one of them in
shows your connection string in properties. You can copy paste that
connection string into your web.config

---
WBR, Michael Nemtsev [Microsoft MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
A> I find two such strings as shown below.
A> A> I see now that who ever wrote this assumed it would be used
with the
A> Express
A> version.
A> How do I change it to point to the SQL Server2005?
A> Also, I do see the file Personal.mdf in the solution list of file
A> names.
A> But I do not see the file aspnetdb.mdf there. Do you thing the
A> program might
A> create it when it runs?
A> Finally, the error message mentioned SQL2005 as if it converted
from
A> the Express to 2005 since that is what it found. If that's the
case
A> why didn't it make the connection?
A> A> Very confusing!
A> A> Thanks for the help
A> A> ...
A> <add name="Personal" connectionString="Data
A> Source=.\SQLExpress;Integrated
A> Security=True;User
A> Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf"
A> providerName="System.Data.SqlClient"/>
A> <remove name="LocalSqlServer"/>
A> <add name="LocalSqlServer" connectionString="Data
A> Source=.\SQLExpress;Integrated Security=True;User
A> Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf"/>
A> </connectionStrings>
A> "Michael Nemtsev [MVP]" <nemtsev@xxxxxxx> wrote in message
A> news:900895ec54ff98cab6cdddc6f310@xxxxxxxxxxxxxxxxxxxxxxx
A>
Hello AAaron123,

Check the web.config, where should be the "connectionstring"
attribute,
where they specify where to connect
of this can be somewhere in code
---
WBR, Michael Nemtsev [Microsoft MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
A> I downloaded the personal website starter kit and when I run it
I
get
A> the
A> error shown below.
A> I found a way of using Launch Surface Area Configuration that
is
A> supposed
A> to fix the remote setting but I tried it and still get the
error.
A> I do not have SQL Server 2005 installed (thought I did once). I
do
A> have SQL Server 2008 installed.
A> A> I don't see anywhere in the code where SQL Server 2005 is
referenced.
A> A> Don't I have to tell in the code that I want to use SQL
Server
2008?
A> Suppose I hade both on my machine?
A> A> Do I have some registry entry that did not get up dated from
the
2005
A> to the 2008 versions?
A> A> Thanks for any help.
A> A> An error has occurred while establishing a connection to the
server.
A> When
A> connecting to SQL Server 2005, this failure may be caused by the
fact
A> that
A> under the default settings SQL Server does not allow remote
A> connections.
A> (provider: SQL Network Interfaces, error: 26 - Error Locating
A> Server/Instance Specified)
A> Description: An unhandled exception occurred during the
execution
of
A> the
A> current web request. Please review the stack trace for more
A> information
A> about the error and where it originated in the code.
A> Exception Details: System.Data.SqlClient.SqlException: An error
has
A> occurred while establishing a connection to the server. When
A> connecting to SQL Server 2005, this failure may be caused by the
fact
A> that under the default settings SQL Server does not allow remote
A> connections. (provider: SQL Network Interfaces, error: 26 -
Error
A> Locating Server/Instance Specified)
A> A> Source Error:
A> A> Line 194: Using command As New
SqlCommand("GetNonEmptyAlbums",
A> connection)
A> Line 195: command.CommandType = CommandType.StoredProcedure
A> Line 196: connection.Open()
A> Line 197: Dim list As New Generic.List(Of Album)()
A> Line 198: Using reader As SqlDataReader = command.ExecuteReader
A> Source File: I:\MyDocuments\Visual Studio
A> 2008\WebSites\PersonalWebSite1\App_Code\PhotoManager.vb Line:
196
A>








.



Relevant Pages

  • Re: Very strange behavior of SQLServer with connection from CGI
    ... or connection pooling issue. ... Older MDAC versions have problems with named instance ... Microsoft SQL Server MVP ... > Does my customer has to tell me the instance port or can I get it in> some other way? ...
    (microsoft.public.sqlserver.connect)
  • Re: Very strange behavior of SQLServer with connection from CGI
    ... or connection pooling issue. ... Older MDAC versions have problems with named instance ... Microsoft SQL Server MVP ... > Does my customer has to tell me the instance port or can I get it in> some other way? ...
    (microsoft.public.sqlserver.clustering)
  • Re: Very strange behavior of SQLServer with connection from CGI
    ... or connection pooling issue. ... Older MDAC versions have problems with named instance ... Microsoft SQL Server MVP ... > Does my customer has to tell me the instance port or can I get it in> some other way? ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Network Interfaces, error: 26
    ... what happens is that SQLExpress is the default name used for its named instance. ... For SQL Server 2000, it's the same. ... but most installations create a named instance which needs to be added in order to ... Just specify you PC name in the connection string ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Error "SQL Server does not allow remote connections"
    ... The application could not connect to the sql server db. ... network is blocking the connection. ... SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 ... integratedSecurity, SqlConnection owningObject) +737554 ...
    (microsoft.public.dotnet.framework.aspnet)