SQL Network Interfaces, error: 26

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AAaron123

    SQL Network Interfaces, error: 26


    I downloaded the personal website starter kit and when I run it I get the
    error shown below.
    I found a way of using Launch Surface Area Configuration that is supposed
    to fix the remote setting but I tried it and still get the error.

    I do not have SQL Server 2005 installed (thought I did once). I do have SQL
    Server 2008 installed.

    I don't see anywhere in the code where SQL Server 2005 is referenced.

    Don't I have to tell in the code that I want to use SQL Server 2008?
    Suppose I hade both on my machine?

    Do I have some registry entry that did not get up dated from the 2005 to the
    2008 versions?

    Thanks for any help.



    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: SQL Network Interfaces, error: 26 - Error Locating
    Server/Instance Specified)
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
    Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Source Error:

    Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" , connection)
    Line 195: command.Command Type = CommandType.Sto redProcedure
    Line 196: connection.Open ()
    Line 197: Dim list As New Generic.List(Of Album)()
    Line 198: Using reader As SqlDataReader = command.Execute Reader

    Source File: I:\MyDocuments\ Visual Studio
    2008\WebSites\P ersonalWebSite1 \App_Code\Photo Manager.vb Line: 196



  • Michael Nemtsev [MVP]

    #2
    Re: SQL Network Interfaces, error: 26

    Hello AAaron123,

    Check the web.config, where should be the "connectionstri ng" 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


    AI downloaded the personal website starter kit and when I run it I get
    Athe
    Aerror shown below.
    AI found a way of using Launch Surface Area Configuration that is
    Asupposed
    Ato fix the remote setting but I tried it and still get the error.
    AI do not have SQL Server 2005 installed (thought I did once). I do
    Ahave SQL Server 2008 installed.
    A>
    AI don't see anywhere in the code where SQL Server 2005 is referenced.
    A>
    ADon't I have to tell in the code that I want to use SQL Server 2008?
    ASuppose I hade both on my machine?
    A>
    ADo I have some registry entry that did not get up dated from the 2005
    Ato the 2008 versions?
    A>
    AThanks for any help.
    A>
    AAn error has occurred while establishing a connection to the server.
    AWhen
    Aconnecting to SQL Server 2005, this failure may be caused by the fact
    Athat
    Aunder the default settings SQL Server does not allow remote
    Aconnections.
    A(provider: SQL Network Interfaces, error: 26 - Error Locating
    AServer/Instance Specified)
    ADescription: An unhandled exception occurred during the execution of
    Athe
    Acurrent web request. Please review the stack trace for more
    Ainformation
    Aabout the error and where it originated in the code.
    AException Details: System.Data.Sql Client.SqlExcep tion: An error has
    Aoccurred while establishing a connection to the server. When
    Aconnecting to SQL Server 2005, this failure may be caused by the fact
    Athat under the default settings SQL Server does not allow remote
    Aconnections. (provider: SQL Network Interfaces, error: 26 - Error
    ALocating Server/Instance Specified)
    A>
    ASource Error:
    A>
    ALine 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
    Aconnection)
    ALine 195: command.Command Type = CommandType.Sto redProcedure
    ALine 196: connection.Open ()
    ALine 197: Dim list As New Generic.List(Of Album)()
    ALine 198: Using reader As SqlDataReader = command.Execute Reader
    ASource File: I:\MyDocuments\ Visual Studio
    A2008\WebSites\ PersonalWebSite 1\App_Code\Phot oManager.vb Line: 196
    A>


    Comment

    • AAaron123

      #3
      Re: SQL Network Interfaces, error: 26

      I do have SQL Server 2005 installed.
      I previously had SQL Server 2008 Express installed.

      I downloaded the personal website starter kit and when I run it I get the
      error shown below.

      I found a way of using Launch Surface Area Configuration that is supposed
      to fix the remote setting but I tried it and still get the error.

      I don't see anywhere in the code where SQL Server 2005 is referenced.

      Don't I have to tell in the code that I want to use SQL Server 2005?
      Suppose I hade mutilple versions on my machine?

      Do I have some registry entry that did not get up dated from the 2008
      express
      to the 2005 versions?

      Thanks for any help.



      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: SQL Network Interfaces, error: 26 - Error Locating
      Server/Instance Specified)
      Description: An unhandled exception occurred during the execution of the
      current web request. Please review the stack trace for more information
      about the error and where it originated in the code.

      Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
      Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

      Source Error:

      Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" , connection)
      Line 195: command.Command Type = CommandType.Sto redProcedure
      Line 196: connection.Open ()
      Line 197: Dim list As New Generic.List(Of Album)()
      Line 198: Using reader As SqlDataReader = command.Execute Reader

      Source File: I:\MyDocuments\ Visual Studio
      2008\WebSites\P ersonalWebSite1 \App_Code\Photo Manager.vb Line: 196




      Comment

      • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

        #4
        RE: SQL Network Interfaces, error: 26

        the error means the sqlserver specified in the connection string was not
        found. if you had both sqlserver 2005 & 2008, the 2008 is probably not the
        default instance. either specify the instance, or create a new default
        instance (reinstall sqlserver 2008)

        -- bruce (sqlwork.com)


        "AAaron123" wrote:
        >
        I downloaded the personal website starter kit and when I run it I get the
        error shown below.
        I found a way of using Launch Surface Area Configuration that is supposed
        to fix the remote setting but I tried it and still get the error.
        >
        I do not have SQL Server 2005 installed (thought I did once). I do have SQL
        Server 2008 installed.
        >
        I don't see anywhere in the code where SQL Server 2005 is referenced.
        >
        Don't I have to tell in the code that I want to use SQL Server 2008?
        Suppose I hade both on my machine?
        >
        Do I have some registry entry that did not get up dated from the 2005 to the
        2008 versions?
        >
        Thanks for any help.
        >
        >
        >
        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: SQL Network Interfaces, error: 26 - Error Locating
        Server/Instance Specified)
        Description: An unhandled exception occurred during the execution of the
        current web request. Please review the stack trace for more information
        about the error and where it originated in the code.
        >
        Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
        Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
        >
        Source Error:
        >
        Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" , connection)
        Line 195: command.Command Type = CommandType.Sto redProcedure
        Line 196: connection.Open ()
        Line 197: Dim list As New Generic.List(Of Album)()
        Line 198: Using reader As SqlDataReader = command.Execute Reader
        >
        Source File: I:\MyDocuments\ Visual Studio
        2008\WebSites\P ersonalWebSite1 \App_Code\Photo Manager.vb Line: 196
        >
        >
        >
        >

        Comment

        • AAaron123

          #5
          Re: SQL Network Interfaces, error: 26

          I find two such strings as shown below.

          I see now that who ever wrote this assumed it would be used with the Express
          version.
          How do I change it to point to the SQL Server2005?


          Also, I do see the file Personal.mdf in the solution list of file names.
          But I do not see the file aspnetdb.mdf there. Do you thing the program might
          create it when it runs?

          Finally, the error message mentioned SQL2005 as if it converted from the
          Express to 2005 since that is what it found. If that's the case why didn't
          it make the connection?

          Very confusing!

          Thanks for the help



          ....
          <add name="Personal" connectionStrin g="Data Source=.\SQLExp ress;Integrated
          Security=True;U ser
          Instance=True;A ttachDBFilename =|DataDirectory |Personal.mdf"
          providerName="S ystem.Data.SqlC lient"/>
          <remove name="LocalSqlS erver"/>
          <add name="LocalSqlS erver" connectionStrin g="Data
          Source=.\SQLExp ress;Integrated Security=True;U ser
          Instance=True;A ttachDBFilename =|DataDirectory |aspnetdb.mdf"/>
          </connectionStrin gs>



          "Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
          news:900895ec54 ff98cab6cdddc6f 310@msnews.micr osoft.com...
          Hello AAaron123,
          >
          Check the web.config, where should be the "connectionstri ng" attribute,
          where they specify where to connect
          of this can be somewhere in code
          >
          ---
          WBR, Michael Nemtsev [Microsoft MVP] :: blog:

          "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
          >
          AI downloaded the personal website starter kit and when I run it I get
          Athe
          Aerror shown below.
          AI found a way of using Launch Surface Area Configuration that is
          Asupposed
          Ato fix the remote setting but I tried it and still get the error.
          AI do not have SQL Server 2005 installed (thought I did once). I do
          Ahave SQL Server 2008 installed.
          AAI don't see anywhere in the code where SQL Server 2005 is
          referenced.
          AADon't I have to tell in the code that I want to use SQL Server 2008?
          ASuppose I hade both on my machine?
          AADo I have some registry entry that did not get up dated from the
          2005
          Ato the 2008 versions?
          AAThanks for any help.
          AAAn error has occurred while establishing a connection to the server.
          AWhen
          Aconnecting to SQL Server 2005, this failure may be caused by the fact
          Athat
          Aunder the default settings SQL Server does not allow remote
          Aconnections.
          A(provider: SQL Network Interfaces, error: 26 - Error Locating
          AServer/Instance Specified)
          ADescription: An unhandled exception occurred during the execution of
          Athe
          Acurrent web request. Please review the stack trace for more
          Ainformation
          Aabout the error and where it originated in the code.
          AException Details: System.Data.Sql Client.SqlExcep tion: An error has
          Aoccurred while establishing a connection to the server. When
          Aconnecting to SQL Server 2005, this failure may be caused by the fact
          Athat under the default settings SQL Server does not allow remote
          Aconnections. (provider: SQL Network Interfaces, error: 26 - Error
          ALocating Server/Instance Specified)
          AASource Error:
          AALine 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
          Aconnection)
          ALine 195: command.Command Type = CommandType.Sto redProcedure
          ALine 196: connection.Open ()
          ALine 197: Dim list As New Generic.List(Of Album)()
          ALine 198: Using reader As SqlDataReader = command.Execute Reader
          ASource File: I:\MyDocuments\ Visual Studio
          A2008\WebSites\ PersonalWebSite 1\App_Code\Phot oManager.vb Line: 196
          A>
          >

          Comment

          • AAaron123

            #6
            Re: SQL Network Interfaces, error: 26

            I'll ask you the same questions I asked Michael Nemtsev.

            I find two such strings as shown below.

            I see now that who ever wrote this assumed it would be used with the Express
            version.
            How do I change it to point to the SQL Server2005?


            Also, I do see the file Personal.mdf in the solution list of file names.
            But I do not see the file aspnetdb.mdf there. Do you thing the program might
            create it when it runs?

            Finally, the error message mentioned SQL2005 as if it converted from the
            Express to 2005 since that is what it found. If that's the case why didn't
            it make the connection?

            Very confusing!

            Thanks for the help

            "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
            news:1A494C34-B560-45BC-B9E2-4D6378505776@mi crosoft.com...
            the error means the sqlserver specified in the connection string was not
            found. if you had both sqlserver 2005 & 2008, the 2008 is probably not the
            default instance. either specify the instance, or create a new default
            instance (reinstall sqlserver 2008)
            >
            -- bruce (sqlwork.com)
            >
            >
            "AAaron123" wrote:
            >
            >>
            >I downloaded the personal website starter kit and when I run it I get the
            >error shown below.
            >I found a way of using Launch Surface Area Configuration that is
            >supposed
            >to fix the remote setting but I tried it and still get the error.
            >>
            >I do not have SQL Server 2005 installed (thought I did once). I do have
            >SQL
            >Server 2008 installed.
            >>
            >I don't see anywhere in the code where SQL Server 2005 is referenced.
            >>
            >Don't I have to tell in the code that I want to use SQL Server 2008?
            >Suppose I hade both on my machine?
            >>
            >Do I have some registry entry that did not get up dated from the 2005 to
            >the
            >2008 versions?
            >>
            >Thanks for any help.
            >>
            >>
            >>
            >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: SQL Network Interfaces, error: 26 - Error Locating
            >Server/Instance Specified)
            >Description: An unhandled exception occurred during the execution of the
            >current web request. Please review the stack trace for more information
            >about the error and where it originated in the code.
            >>
            >Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
            >Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
            >>
            >Source Error:
            >>
            >Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
            >connection)
            >Line 195: command.Command Type = CommandType.Sto redProcedure
            >Line 196: connection.Open ()
            >Line 197: Dim list As New Generic.List(Of Album)()
            >Line 198: Using reader As SqlDataReader = command.Execute Reader
            >>
            >Source File: I:\MyDocuments\ Visual Studio
            >2008\WebSites\ PersonalWebSite 1\App_Code\Phot oManager.vb Line: 196
            >>
            >>
            >>
            >>

            Comment

            • Michael Nemtsev [MVP]

              #7
              Re: SQL Network Interfaces, error: 26

              Hello AAaron123,

              ".\SQLExpre ss" 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)

              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


              AI find two such strings as shown below.
              A>
              AI see now that who ever wrote this assumed it would be used with the
              AExpress
              Aversion.
              AHow do I change it to point to the SQL Server2005?
              AAlso, I do see the file Personal.mdf in the solution list of file
              Anames.
              ABut I do not see the file aspnetdb.mdf there. Do you thing the
              Aprogram might
              Acreate it when it runs?
              AFinally, the error message mentioned SQL2005 as if it converted from
              Athe Express to 2005 since that is what it found. If that's the case
              Awhy didn't it make the connection?
              A>
              AVery confusing!
              A>
              AThanks for the help
              A>
              A...
              A<add name="Personal" connectionStrin g="Data
              ASource=.\SQLEx press;Integrate d
              ASecurity=True; User
              AInstance=True; AttachDBFilenam e=|DataDirector y|Personal.mdf"
              AproviderName=" System.Data.Sql Client"/>
              A<remove name="LocalSqlS erver"/>
              A<add name="LocalSqlS erver" connectionStrin g="Data
              ASource=.\SQLEx press;Integrate d Security=True;U ser
              AInstance=True; AttachDBFilenam e=|DataDirector y|aspnetdb.mdf"/>
              A</connectionStrin gs>
              A"Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
              Anews:900895ec5 4ff98cab6cdddc6 f310@msnews.mic rosoft.com...
              A>
              >Hello AAaron123,
              >>
              >Check the web.config, where should be the "connectionstri ng"
              >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
              >AI downloaded the personal website starter kit and when I run it I
              >get
              >Athe
              >Aerror shown below.
              >AI found a way of using Launch Surface Area Configuration that is
              >Asupposed
              >Ato fix the remote setting but I tried it and still get the error.
              >AI do not have SQL Server 2005 installed (thought I did once). I do
              >Ahave SQL Server 2008 installed.
              >AAI don't see anywhere in the code where SQL Server 2005 is
              >referenced.
              >AADon't I have to tell in the code that I want to use SQL Server
              >2008?
              >ASuppose I hade both on my machine?
              >AADo I have some registry entry that did not get up dated from
              >the
              >2005
              >Ato the 2008 versions?
              >AAThanks for any help.
              >AAAn error has occurred while establishing a connection to the
              >server.
              >AWhen
              >Aconnecting to SQL Server 2005, this failure may be caused by the
              >fact
              >Athat
              >Aunder the default settings SQL Server does not allow remote
              >Aconnections .
              >A(provider: SQL Network Interfaces, error: 26 - Error Locating
              >AServer/Instance Specified)
              >ADescription : An unhandled exception occurred during the execution
              >of
              >Athe
              >Acurrent web request. Please review the stack trace for more
              >Ainformation
              >Aabout the error and where it originated in the code.
              >AException Details: System.Data.Sql Client.SqlExcep tion: An error
              >has
              >Aoccurred while establishing a connection to the server. When
              >Aconnecting to SQL Server 2005, this failure may be caused by the
              >fact
              >Athat under the default settings SQL Server does not allow remote
              >Aconnections . (provider: SQL Network Interfaces, error: 26 - Error
              >ALocating Server/Instance Specified)
              >AASource Error:
              >AALine 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
              >Aconnection)
              >ALine 195: command.Command Type = CommandType.Sto redProcedure
              >ALine 196: connection.Open ()
              >ALine 197: Dim list As New Generic.List(Of Album)()
              >ALine 198: Using reader As SqlDataReader = command.Execute Reader
              >ASource File: I:\MyDocuments\ Visual Studio
              >A2008\WebSites \PersonalWebSit e1\App_Code\Pho toManager.vb Line:
              >196
              >A>

              Comment

              • bruce barker

                #8
                Re: SQL Network Interfaces, error: 26

                a mdf file is a detached database. to create one you create a database
                in sqlserver, then detach it (via a sql command).

                in the connect string you can specify a mdf to auto attach which is
                useful for simple sites. you can upload the database then attach on the
                first connect.

                from a programs point of view there is no difference between sqlexpress
                and sqlserver 2005. only the license is different, and the tools
                supplied.

                to connect to a sqlserver you need to know the server its on and the
                instance name. this is specified in the connect string, along with
                default database, and an attach command if desired.

                if you have sql2005, then run the management studio and browse for
                sqlservers. this will list the instance names.


                read the docs on sqlserver connect strings

                -- bruce (sqlwork.com)



                AAaron123 wrote:
                I'll ask you the same questions I asked Michael Nemtsev.
                >
                I find two such strings as shown below.
                >
                I see now that who ever wrote this assumed it would be used with the Express
                version.
                How do I change it to point to the SQL Server2005?
                >
                >
                Also, I do see the file Personal.mdf in the solution list of file names.
                But I do not see the file aspnetdb.mdf there. Do you thing the program might
                create it when it runs?
                >
                Finally, the error message mentioned SQL2005 as if it converted from the
                Express to 2005 since that is what it found. If that's the case why didn't
                it make the connection?
                >
                Very confusing!
                >
                Thanks for the help
                >
                "bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
                news:1A494C34-B560-45BC-B9E2-4D6378505776@mi crosoft.com...
                >the error means the sqlserver specified in the connection string was not
                >found. if you had both sqlserver 2005 & 2008, the 2008 is probably not the
                >default instance. either specify the instance, or create a new default
                >instance (reinstall sqlserver 2008)
                >>
                >-- bruce (sqlwork.com)
                >>
                >>
                >"AAaron123" wrote:
                >>
                >>I downloaded the personal website starter kit and when I run it I get the
                >>error shown below.
                >>I found a way of using Launch Surface Area Configuration that is
                >>supposed
                >>to fix the remote setting but I tried it and still get the error.
                >>>
                >>I do not have SQL Server 2005 installed (thought I did once). I do have
                >>SQL
                >>Server 2008 installed.
                >>>
                >>I don't see anywhere in the code where SQL Server 2005 is referenced.
                >>>
                >>Don't I have to tell in the code that I want to use SQL Server 2008?
                >>Suppose I hade both on my machine?
                >>>
                >>Do I have some registry entry that did not get up dated from the 2005 to
                >>the
                >>2008 versions?
                >>>
                >>Thanks for any help.
                >>>
                >>>
                >>>
                >>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: SQL Network Interfaces, error: 26 - Error Locating
                >>Server/Instance Specified)
                >>Description : An unhandled exception occurred during the execution of the
                >>current web request. Please review the stack trace for more information
                >>about the error and where it originated in the code.
                >>>
                >>Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
                >>Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
                >>>
                >>Source Error:
                >>>
                >>Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
                >>connection)
                >>Line 195: command.Command Type = CommandType.Sto redProcedure
                >>Line 196: connection.Open ()
                >>Line 197: Dim list As New Generic.List(Of Album)()
                >>Line 198: Using reader As SqlDataReader = command.Execute Reader
                >>>
                >>Source File: I:\MyDocuments\ Visual Studio
                >>2008\WebSites \PersonalWebSit e1\App_Code\Pho toManager.vb Line: 196
                >>>
                >>>
                >>>
                >>>
                >
                >

                Comment

                • AAaron123

                  #9
                  Re: SQL Network Interfaces, error: 26


                  "bruce barker" <nospam@nospam. comwrote in message
                  news:e$MOpcI6IH A.4352@TK2MSFTN GP03.phx.gbl...
                  >a mdf file is a detached database. to create one you create a database in
                  >sqlserver, then detach it (via a sql command).
                  >
                  in the connect string you can specify a mdf to auto attach which is useful
                  for simple sites. you can upload the database then attach on the first
                  connect.
                  >
                  from a programs point of view there is no difference between sqlexpress
                  and sqlserver 2005. only the license is different, and the tools supplied.
                  >
                  to connect to a sqlserver you need to know the server its on and the
                  instance name. this is specified in the connect string, along with default
                  database, and an attach command if desired.
                  >
                  if you have sql2005, then run the management studio and browse for
                  sqlservers. this will list the instance names.


                  The default instance is unnamed and is shown as the computer name.
                  How do I reference that in the
                  connectionStrin g="Data Source=

                  thanks for staying with me

                  >
                  >
                  read the docs on sqlserver connect strings
                  This helped using management studio
                  >
                  -- bruce (sqlwork.com)
                  >
                  >
                  >
                  AAaron123 wrote:
                  >I'll ask you the same questions I asked Michael Nemtsev.
                  >>
                  >I find two such strings as shown below.
                  >>
                  >I see now that who ever wrote this assumed it would be used with the
                  >Express version.
                  >How do I change it to point to the SQL Server2005?
                  >>
                  >>
                  >Also, I do see the file Personal.mdf in the solution list of file names.
                  >But I do not see the file aspnetdb.mdf there. Do you thing the program
                  >might create it when it runs?
                  >>
                  >Finally, the error message mentioned SQL2005 as if it converted from the
                  >Express to 2005 since that is what it found. If that's the case why
                  >didn't it make the connection?
                  >>
                  >Very confusing!
                  >>
                  >Thanks for the help
                  >>
                  >"bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
                  >news:1A494C3 4-B560-45BC-B9E2-4D6378505776@mi crosoft.com...
                  >>the error means the sqlserver specified in the connection string was not
                  >>found. if you had both sqlserver 2005 & 2008, the 2008 is probably not
                  >>the
                  >>default instance. either specify the instance, or create a new default
                  >>instance (reinstall sqlserver 2008)
                  >>>
                  >>-- bruce (sqlwork.com)
                  >>>
                  >>>
                  >>"AAaron123" wrote:
                  >>>
                  >>>I downloaded the personal website starter kit and when I run it I get
                  >>>the
                  >>>error shown below.
                  >>>I found a way of using Launch Surface Area Configuration that is
                  >>>supposed
                  >>>to fix the remote setting but I tried it and still get the error.
                  >>>>
                  >>>I do not have SQL Server 2005 installed (thought I did once). I do have
                  >>>SQL
                  >>>Server 2008 installed.
                  >>>>
                  >>>I don't see anywhere in the code where SQL Server 2005 is referenced.
                  >>>>
                  >>>Don't I have to tell in the code that I want to use SQL Server 2008?
                  >>>Suppose I hade both on my machine?
                  >>>>
                  >>>Do I have some registry entry that did not get up dated from the 2005
                  >>>to the
                  >>>2008 versions?
                  >>>>
                  >>>Thanks for any help.
                  >>>>
                  >>>>
                  >>>>
                  >>>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
                  >>>connection s.
                  >>>(provider: SQL Network Interfaces, error: 26 - Error Locating
                  >>>Server/Instance Specified)
                  >>>Descriptio n: An unhandled exception occurred during the execution of
                  >>>the
                  >>>current web request. Please review the stack trace for more information
                  >>>about the error and where it originated in the code.
                  >>>>
                  >>>Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
                  >>>Network Interfaces, error: 26 - Error Locating Server/Instance
                  >>>Specified)
                  >>>>
                  >>>Source Error:
                  >>>>
                  >>>Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
                  >>>connection )
                  >>>Line 195: command.Command Type = CommandType.Sto redProcedure
                  >>>Line 196: connection.Open ()
                  >>>Line 197: Dim list As New Generic.List(Of Album)()
                  >>>Line 198: Using reader As SqlDataReader = command.Execute Reader
                  >>>>
                  >>>Source File: I:\MyDocuments\ Visual Studio
                  >>>2008\WebSite s\PersonalWebSi te1\App_Code\Ph otoManager.vb Line: 196
                  >>>>
                  >>>>
                  >>>>
                  >>>>
                  >>

                  Comment

                  • AAaron123

                    #10
                    Re: SQL Network Interfaces, error: 26



                    "Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
                    news:900895ec55 0718cab6e4394c8 1d0@msnews.micr osoft.com...
                    Hello AAaron123,
                    >
                    ".\SQLExpre ss" 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)

                    The default instance is unnamed and is shown as the computer name.
                    How do I reference that in the
                    connectionStrin g="Data Source=

                    thanks for staying with me
                    >
                    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:

                    "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
                    >
                    AI find two such strings as shown below.
                    AAI see now that who ever wrote this assumed it would be used with the
                    AExpress
                    Aversion.
                    AHow do I change it to point to the SQL Server2005?
                    AAlso, I do see the file Personal.mdf in the solution list of file
                    Anames.
                    ABut I do not see the file aspnetdb.mdf there. Do you thing the
                    Aprogram might
                    Acreate it when it runs?
                    AFinally, the error message mentioned SQL2005 as if it converted from
                    Athe Express to 2005 since that is what it found. If that's the case
                    Awhy didn't it make the connection?
                    AAVery confusing!
                    AAThanks for the help
                    AA...
                    A<add name="Personal" connectionStrin g="Data
                    ASource=.\SQLEx press;Integrate d
                    ASecurity=True; User
                    AInstance=True; AttachDBFilenam e=|DataDirector y|Personal.mdf"
                    AproviderName=" System.Data.Sql Client"/>
                    A<remove name="LocalSqlS erver"/>
                    A<add name="LocalSqlS erver" connectionStrin g="Data
                    ASource=.\SQLEx press;Integrate d Security=True;U ser
                    AInstance=True; AttachDBFilenam e=|DataDirector y|aspnetdb.mdf"/>
                    A</connectionStrin gs>
                    A"Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
                    Anews:900895ec5 4ff98cab6cdddc6 f310@msnews.mic rosoft.com...
                    A>
                    >>Hello AAaron123,
                    >>>
                    >>Check the web.config, where should be the "connectionstri ng"
                    >>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
                    >>AI downloaded the personal website starter kit and when I run it I
                    >>get
                    >>Athe
                    >>Aerror shown below.
                    >>AI found a way of using Launch Surface Area Configuration that is
                    >>Asupposed
                    >>Ato fix the remote setting but I tried it and still get the error.
                    >>AI do not have SQL Server 2005 installed (thought I did once). I do
                    >>Ahave SQL Server 2008 installed.
                    >>AAI don't see anywhere in the code where SQL Server 2005 is
                    >>referenced.
                    >>AADon't I have to tell in the code that I want to use SQL Server
                    >>2008?
                    >>ASuppose I hade both on my machine?
                    >>AADo I have some registry entry that did not get up dated from
                    >>the
                    >>2005
                    >>Ato the 2008 versions?
                    >>AAThanks for any help.
                    >>AAAn error has occurred while establishing a connection to the
                    >>server.
                    >>AWhen
                    >>Aconnecting to SQL Server 2005, this failure may be caused by the
                    >>fact
                    >>Athat
                    >>Aunder the default settings SQL Server does not allow remote
                    >>Aconnection s.
                    >>A(provider: SQL Network Interfaces, error: 26 - Error Locating
                    >>AServer/Instance Specified)
                    >>ADescriptio n: An unhandled exception occurred during the execution
                    >>of
                    >>Athe
                    >>Acurrent web request. Please review the stack trace for more
                    >>Ainformatio n
                    >>Aabout the error and where it originated in the code.
                    >>AException Details: System.Data.Sql Client.SqlExcep tion: An error
                    >>has
                    >>Aoccurred while establishing a connection to the server. When
                    >>Aconnecting to SQL Server 2005, this failure may be caused by the
                    >>fact
                    >>Athat under the default settings SQL Server does not allow remote
                    >>Aconnection s. (provider: SQL Network Interfaces, error: 26 - Error
                    >>ALocating Server/Instance Specified)
                    >>AASource Error:
                    >>AALine 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
                    >>Aconnection )
                    >>ALine 195: command.Command Type = CommandType.Sto redProcedure
                    >>ALine 196: connection.Open ()
                    >>ALine 197: Dim list As New Generic.List(Of Album)()
                    >>ALine 198: Using reader As SqlDataReader = command.Execute Reader
                    >>ASource File: I:\MyDocuments\ Visual Studio
                    >>A2008\WebSite s\PersonalWebSi te1\App_Code\Ph otoManager.vb Line:
                    >>196
                    >>A>
                    >
                    >

                    Comment

                    • Juan T. Llibre

                      #11
                      Re: SQL Network Interfaces, error: 26

                      re:
                      !How do I reference that in the connectionStrin g="Data Source=

                      Use the same name which the SQL Server Service Manager shows.

                      You should have an icon for the SQL Server Service Manager in your Taskbar Tray.
                      Double click it...and use the exact name it shows.

                      If the service manager isn't running, run it from
                      "Start Menu", "Programs", "SQL Server", "Service Manager".





                      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@road runner.comwrote in message news:eKw7iPN6IH A.1592@TK2MSFTN GP04.phx.gbl...
                      >
                      "bruce barker" <nospam@nospam. comwrote in message news:e$MOpcI6IH A.4352@TK2MSFTN GP03.phx.gbl...
                      >>a mdf file is a detached database. to create one you create a database in sqlserver, then detach it (via a sql
                      >>command).
                      >>
                      >in the connect string you can specify a mdf to auto attach which is useful for simple sites. you can upload the
                      >database then attach on the first connect.
                      >>
                      >from a programs point of view there is no difference between sqlexpress and sqlserver 2005. only the license is
                      >different, and the tools supplied.
                      >>
                      >to connect to a sqlserver you need to know the server its on and the instance name. this is specified in the connect
                      >string, along with default database, and an attach command if desired.
                      >>
                      >if you have sql2005, then run the management studio and browse for sqlservers. this will list the instance names.
                      >
                      >
                      >
                      The default instance is unnamed and is shown as the computer name.
                      How do I reference that in the
                      connectionStrin g="Data Source=
                      >
                      thanks for staying with me
                      >
                      >
                      >>
                      >>
                      >read the docs on sqlserver connect strings
                      >
                      This helped using management studio
                      >
                      >>
                      >-- bruce (sqlwork.com)
                      >>
                      >>
                      >>
                      >AAaron123 wrote:
                      >>I'll ask you the same questions I asked Michael Nemtsev.
                      >>>
                      >>I find two such strings as shown below.
                      >>>
                      >>I see now that who ever wrote this assumed it would be used with the Express version.
                      >>How do I change it to point to the SQL Server2005?
                      >>>
                      >>>
                      >>Also, I do see the file Personal.mdf in the solution list of file names.
                      >>But I do not see the file aspnetdb.mdf there. Do you thing the program might create it when it runs?
                      >>>
                      >>Finally, the error message mentioned SQL2005 as if it converted from the Express to 2005 since that is what it
                      >>found. If that's the case why didn't it make the connection?
                      >>>
                      >>Very confusing!
                      >>>
                      >>Thanks for the help
                      >>>
                      >>"bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
                      >>news:1A494C 34-B560-45BC-B9E2-4D6378505776@mi crosoft.com...
                      >>>the error means the sqlserver specified in the connection string was not
                      >>>found. if you had both sqlserver 2005 & 2008, the 2008 is probably not the
                      >>>default instance. either specify the instance, or create a new default
                      >>>instance (reinstall sqlserver 2008)
                      >>>>
                      >>>-- bruce (sqlwork.com)
                      >>>>
                      >>>>
                      >>>"AAaron123 " wrote:
                      >>>>
                      >>>>I downloaded the personal website starter kit and when I run it I get the
                      >>>>error shown below.
                      >>>>I found a way of using Launch Surface Area Configuration that is supposed
                      >>>>to fix the remote setting but I tried it and still get the error.
                      >>>>>
                      >>>>I do not have SQL Server 2005 installed (thought I did once). I do have SQL
                      >>>>Server 2008 installed.
                      >>>>>
                      >>>>I don't see anywhere in the code where SQL Server 2005 is referenced.
                      >>>>>
                      >>>>Don't I have to tell in the code that I want to use SQL Server 2008?
                      >>>>Suppose I hade both on my machine?
                      >>>>>
                      >>>>Do I have some registry entry that did not get up dated from the 2005 to the
                      >>>>2008 versions?
                      >>>>>
                      >>>>Thanks for any help.
                      >>>>>
                      >>>>>
                      >>>>>
                      >>>>An error has occurred while establishing a connection to the server. When
                      >>>>connectin g 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 : SQL Network Interfaces, error: 26 - Error Locating
                      >>>>Server/Instance Specified)
                      >>>>Description : An unhandled exception occurred during the execution of the
                      >>>>current web request. Please review the stack trace for more information
                      >>>>about the error and where it originated in the code.
                      >>>>>
                      >>>>Exception Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
                      >>>>Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
                      >>>>>
                      >>>>Source Error:
                      >>>>>
                      >>>>Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" , connection)
                      >>>>Line 195: command.Command Type = CommandType.Sto redProcedure
                      >>>>Line 196: connection.Open ()
                      >>>>Line 197: Dim list As New Generic.List(Of Album)()
                      >>>>Line 198: Using reader As SqlDataReader = command.Execute Reader
                      >>>>>
                      >>>>Source File: I:\MyDocuments\ Visual Studio
                      >>>>2008\WebSit es\PersonalWebS ite1\App_Code\P hotoManager.vb Line: 196
                      >>>>>
                      >>>>>
                      >>>>>
                      >>>>>
                      >>>
                      >

                      Comment

                      • AAaron123

                        #12
                        Re: SQL Network Interfaces, error: 26

                        One of my earlier tries was to simply changed Data Source=./SQLExpress to
                        Data Source=./zz

                        where zz is the name SQL Server Service Manager shows which is just the
                        computer name followed by nothing else. Guess that's the way the default
                        instance is named.

                        That did not work but when I removed the .\ it worked.

                        What does the dot stand for?



                        What if I run the program on another machine? Maybe using just the dot means
                        use the default instance. I'll try that now to see if it works. Comment?



                        I also had to remove User Instance=True which I guess is unique to the
                        Express version. Read the help but still don't know if removing will bite me
                        later. Think so?



                        SQL Server Service Manager Studio does not appear in my Taskbar tray when
                        it's running. Maybe there's an option I have to find for that to happen.

                        Thanks a lot


                        "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
                        news:uEJb6dN6IH A.1468@TK2MSFTN GP05.phx.gbl...
                        re:
                        !How do I reference that in the connectionStrin g="Data Source=
                        >
                        Use the same name which the SQL Server Service Manager shows.
                        >
                        You should have an icon for the SQL Server Service Manager in your Taskbar
                        Tray.
                        Double click it...and use the exact name it shows.
                        >
                        If the service manager isn't running, run it from
                        "Start Menu", "Programs", "SQL Server", "Service Manager".
                        >
                        >
                        >
                        >
                        >
                        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@road runner.comwrote in message
                        news:eKw7iPN6IH A.1592@TK2MSFTN GP04.phx.gbl...
                        >>
                        >"bruce barker" <nospam@nospam. comwrote in message
                        >news:e$MOpcI6I HA.4352@TK2MSFT NGP03.phx.gbl.. .
                        >>>a mdf file is a detached database. to create one you create a database in
                        >>>sqlserver, then detach it (via a sql command).
                        >>>
                        >>in the connect string you can specify a mdf to auto attach which is
                        >>useful for simple sites. you can upload the database then attach on the
                        >>first connect.
                        >>>
                        >>from a programs point of view there is no difference between sqlexpress
                        >>and sqlserver 2005. only the license is different, and the tools
                        >>supplied.
                        >>>
                        >>to connect to a sqlserver you need to know the server its on and the
                        >>instance name. this is specified in the connect string, along with
                        >>default database, and an attach command if desired.
                        >>>
                        >>if you have sql2005, then run the management studio and browse for
                        >>sqlservers. this will list the instance names.
                        >>
                        >>
                        >>
                        >The default instance is unnamed and is shown as the computer name.
                        >How do I reference that in the
                        >connectionStri ng="Data Source=
                        >>
                        >thanks for staying with me
                        >>
                        >>
                        >>>
                        >>>
                        >>read the docs on sqlserver connect strings
                        >>
                        >This helped using management studio
                        >>
                        >>>
                        >>-- bruce (sqlwork.com)
                        >>>
                        >>>
                        >>>
                        >>AAaron123 wrote:
                        >>>I'll ask you the same questions I asked Michael Nemtsev.
                        >>>>
                        >>>I find two such strings as shown below.
                        >>>>
                        >>>I see now that who ever wrote this assumed it would be used with the
                        >>>Express version.
                        >>>How do I change it to point to the SQL Server2005?
                        >>>>
                        >>>>
                        >>>Also, I do see the file Personal.mdf in the solution list of file
                        >>>names.
                        >>>But I do not see the file aspnetdb.mdf there. Do you thing the program
                        >>>might create it when it runs?
                        >>>>
                        >>>Finally, the error message mentioned SQL2005 as if it converted from
                        >>>the Express to 2005 since that is what it found. If that's the case why
                        >>>didn't it make the connection?
                        >>>>
                        >>>Very confusing!
                        >>>>
                        >>>Thanks for the help
                        >>>>
                        >>>"bruce barker" <brucebarker@di scussions.micro soft.comwrote in message
                        >>>news:1A494C3 4-B560-45BC-B9E2-4D6378505776@mi crosoft.com...
                        >>>>the error means the sqlserver specified in the connection string was
                        >>>>not
                        >>>>found. if you had both sqlserver 2005 & 2008, the 2008 is probably not
                        >>>>the
                        >>>>default instance. either specify the instance, or create a new default
                        >>>>instance (reinstall sqlserver 2008)
                        >>>>>
                        >>>>-- bruce (sqlwork.com)
                        >>>>>
                        >>>>>
                        >>>>"AAaron12 3" wrote:
                        >>>>>
                        >>>>>I downloaded the personal website starter kit and when I run it I get
                        >>>>>the
                        >>>>>error shown below.
                        >>>>>I found a way of using Launch Surface Area Configuration that is
                        >>>>>supposed
                        >>>>>to fix the remote setting but I tried it and still get the error.
                        >>>>>>
                        >>>>>I do not have SQL Server 2005 installed (thought I did once). I do
                        >>>>>have SQL
                        >>>>>Server 2008 installed.
                        >>>>>>
                        >>>>>I don't see anywhere in the code where SQL Server 2005 is referenced.
                        >>>>>>
                        >>>>>Don't I have to tell in the code that I want to use SQL Server 2008?
                        >>>>>Suppose I hade both on my machine?
                        >>>>>>
                        >>>>>Do I have some registry entry that did not get up dated from the 2005
                        >>>>>to the
                        >>>>>2008 versions?
                        >>>>>>
                        >>>>>Thanks for any help.
                        >>>>>>
                        >>>>>>
                        >>>>>>
                        >>>>>An error has occurred while establishing a connection to the server.
                        >>>>>When
                        >>>>>connecti ng to SQL Server 2005, this failure may be caused by the fact
                        >>>>>that
                        >>>>>under the default settings SQL Server does not allow remote
                        >>>>>connection s.
                        >>>>>(provide r: SQL Network Interfaces, error: 26 - Error Locating
                        >>>>>Server/Instance Specified)
                        >>>>>Descriptio n: An unhandled exception occurred during the execution of
                        >>>>>the
                        >>>>>current web request. Please review the stack trace for more
                        >>>>>informatio n
                        >>>>>about the error and where it originated in the code.
                        >>>>>>
                        >>>>>Exceptio n Details: System.Data.Sql Client.SqlExcep tion: 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: SQL
                        >>>>>Network Interfaces, error: 26 - Error Locating Server/Instance
                        >>>>>Specifie d)
                        >>>>>>
                        >>>>>Source Error:
                        >>>>>>
                        >>>>>Line 194: Using command As New SqlCommand("Get NonEmptyAlbums" ,
                        >>>>>connection )
                        >>>>>Line 195: command.Command Type = CommandType.Sto redProcedure
                        >>>>>Line 196: connection.Open ()
                        >>>>>Line 197: Dim list As New Generic.List(Of Album)()
                        >>>>>Line 198: Using reader As SqlDataReader = command.Execute Reader
                        >>>>>>
                        >>>>>Source File: I:\MyDocuments\ Visual Studio
                        >>>>>2008\WebSi tes\PersonalWeb Site1\App_Code\ PhotoManager.vb Line: 196
                        >>>>>>
                        >>>>>>
                        >>>>>>
                        >>>>>>
                        >>>>
                        >>
                        >
                        >

                        Comment

                        • Michael Nemtsev [MVP]

                          #13
                          Re: SQL Network Interfaces, error: 26

                          Hello AAaron123,

                          Just specify you PC name in the connection string
                          instead of "Data Source=.\SQLExp ress;
                          use "Data Source=YOUPCNAM E;

                          ---
                          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@msn.co mwrote in message
                          Anews:900895ec5 50718cab6e4394c 81d0@msnews.mic rosoft.com...
                          A>
                          >Hello AAaron123,
                          >>
                          >".\SQLExpres s" 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)
                          >>
                          AThe default instance is unnamed and is shown as the computer name.
                          AHow do I reference that in the
                          AconnectionStri ng="Data Source=
                          Athanks for staying with me
                          A>
                          >Alternativel y, 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
                          >AI find two such strings as shown below.
                          >AAI see now that who ever wrote this assumed it would be used
                          >with the
                          >AExpress
                          >Aversion.
                          >AHow do I change it to point to the SQL Server2005?
                          >AAlso, I do see the file Personal.mdf in the solution list of file
                          >Anames.
                          >ABut I do not see the file aspnetdb.mdf there. Do you thing the
                          >Aprogram might
                          >Acreate it when it runs?
                          >AFinally, the error message mentioned SQL2005 as if it converted
                          >from
                          >Athe Express to 2005 since that is what it found. If that's the
                          >case
                          >Awhy didn't it make the connection?
                          >AAVery confusing!
                          >AAThanks for the help
                          >AA...
                          >A<add name="Personal" connectionStrin g="Data
                          >ASource=.\SQLE xpress;Integrat ed
                          >ASecurity=True ;User
                          >AInstance=True ;AttachDBFilena me=|DataDirecto ry|Personal.mdf "
                          >AproviderName= "System.Data.Sq lClient"/>
                          >A<remove name="LocalSqlS erver"/>
                          >A<add name="LocalSqlS erver" connectionStrin g="Data
                          >ASource=.\SQLE xpress;Integrat ed Security=True;U ser
                          >AInstance=True ;AttachDBFilena me=|DataDirecto ry|aspnetdb.mdf "/>
                          >A</connectionStrin gs>
                          >A"Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
                          >Anews:900895ec 54ff98cab6cdddc 6f310@msnews.mi crosoft.com...
                          >A>
                          >>>Hello AAaron123,
                          >>>>
                          >>>Check the web.config, where should be the "connectionstri ng"
                          >>>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
                          >>>AI downloaded the personal website starter kit and when I run it
                          >>>I
                          >>>get
                          >>>Athe
                          >>>Aerror shown below.
                          >>>AI found a way of using Launch Surface Area Configuration that
                          >>>is
                          >>>Asupposed
                          >>>Ato fix the remote setting but I tried it and still get the
                          >>>error.
                          >>>AI do not have SQL Server 2005 installed (thought I did once). I
                          >>>do
                          >>>Ahave SQL Server 2008 installed.
                          >>>AAI don't see anywhere in the code where SQL Server 2005 is
                          >>>referenced .
                          >>>AADon't I have to tell in the code that I want to use SQL
                          >>>Server
                          >>>2008?
                          >>>ASuppose I hade both on my machine?
                          >>>AADo I have some registry entry that did not get up dated from
                          >>>the
                          >>>2005
                          >>>Ato the 2008 versions?
                          >>>AAThanks for any help.
                          >>>AAAn error has occurred while establishing a connection to the
                          >>>server.
                          >>>AWhen
                          >>>Aconnectin g to SQL Server 2005, this failure may be caused by the
                          >>>fact
                          >>>Athat
                          >>>Aunder the default settings SQL Server does not allow remote
                          >>>Aconnections .
                          >>>A(provider : SQL Network Interfaces, error: 26 - Error Locating
                          >>>AServer/Instance Specified)
                          >>>ADescription : An unhandled exception occurred during the
                          >>>execution
                          >>>of
                          >>>Athe
                          >>>Acurrent web request. Please review the stack trace for more
                          >>>Ainformati on
                          >>>Aabout the error and where it originated in the code.
                          >>>AException Details: System.Data.Sql Client.SqlExcep tion: An error
                          >>>has
                          >>>Aoccurred while establishing a connection to the server. When
                          >>>Aconnectin g to SQL Server 2005, this failure may be caused by the
                          >>>fact
                          >>>Athat under the default settings SQL Server does not allow remote
                          >>>Aconnections . (provider: SQL Network Interfaces, error: 26 -
                          >>>Error
                          >>>ALocating Server/Instance Specified)
                          >>>AASource Error:
                          >>>AALine 194: Using command As New
                          >>>SqlCommand(" GetNonEmptyAlbu ms",
                          >>>Aconnectio n)
                          >>>ALine 195: command.Command Type = CommandType.Sto redProcedure
                          >>>ALine 196: connection.Open ()
                          >>>ALine 197: Dim list As New Generic.List(Of Album)()
                          >>>ALine 198: Using reader As SqlDataReader = command.Execute Reader
                          >>>ASource File: I:\MyDocuments\ Visual Studio
                          >>>A2008\WebSit es\PersonalWebS ite1\App_Code\P hotoManager.vb Line:
                          >>>196
                          >>>A>

                          Comment

                          • AAaron123

                            #14
                            Re: SQL Network Interfaces, error: 26

                            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@msn.co mwrote in message
                            news:900895ec55 9988cab8191cb9c 5b0@msnews.micr osoft.com...
                            Hello AAaron123,
                            >
                            Just specify you PC name in the connection string
                            instead of "Data Source=.\SQLExp ress;
                            use "Data Source=YOUPCNAM E;
                            >
                            ---
                            WBR, Michael Nemtsev [Microsoft MVP] :: blog:

                            "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@msn.co mwrote in message
                            Anews:900895ec5 50718cab6e4394c 81d0@msnews.mic rosoft.com...
                            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)
                            >>>
                            AThe default instance is unnamed and is shown as the computer name.
                            AHow do I reference that in the
                            AconnectionStri ng="Data Source=
                            Athanks 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
                            >>AI find two such strings as shown below.
                            >>AAI see now that who ever wrote this assumed it would be used
                            >>with the
                            >>AExpress
                            >>Aversion.
                            >>AHow do I change it to point to the SQL Server2005?
                            >>AAlso, I do see the file Personal.mdf in the solution list of file
                            >>Anames.
                            >>ABut I do not see the file aspnetdb.mdf there. Do you thing the
                            >>Aprogram might
                            >>Acreate it when it runs?
                            >>AFinally, the error message mentioned SQL2005 as if it converted
                            >>from
                            >>Athe Express to 2005 since that is what it found. If that's the
                            >>case
                            >>Awhy didn't it make the connection?
                            >>AAVery confusing!
                            >>AAThanks for the help
                            >>AA...
                            >>A<add name="Personal" connectionStrin g="Data
                            >>ASource=.\SQL Express;Integra ted
                            >>ASecurity=Tru e;User
                            >>AInstance=Tru e;AttachDBFilen ame=|DataDirect ory|Personal.md f"
                            >>AproviderName ="System.Data.S qlClient"/>
                            >>A<remove name="LocalSqlS erver"/>
                            >>A<add name="LocalSqlS erver" connectionStrin g="Data
                            >>ASource=.\SQL Express;Integra ted Security=True;U ser
                            >>AInstance=Tru e;AttachDBFilen ame=|DataDirect ory|aspnetdb.md f"/>
                            >>A</connectionStrin gs>
                            >>A"Michael Nemtsev [MVP]" <nemtsev@msn.co mwrote in message
                            >>Anews:900895e c54ff98cab6cddd c6f310@msnews.m icrosoft.com...
                            >>A>
                            >>>>Hello AAaron123,
                            >>>>>
                            >>>>Check the web.config, where should be the "connectionstri ng"
                            >>>>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
                            >>>>AI downloaded the personal website starter kit and when I run it
                            >>>>I
                            >>>>get
                            >>>>Athe
                            >>>>Aerror shown below.
                            >>>>AI found a way of using Launch Surface Area Configuration that
                            >>>>is
                            >>>>Asupposed
                            >>>>Ato fix the remote setting but I tried it and still get the
                            >>>>error.
                            >>>>AI do not have SQL Server 2005 installed (thought I did once). I
                            >>>>do
                            >>>>Ahave SQL Server 2008 installed.
                            >>>>AAI don't see anywhere in the code where SQL Server 2005 is
                            >>>>reference d.
                            >>>>AADon't I have to tell in the code that I want to use SQL
                            >>>>Server
                            >>>>2008?
                            >>>>ASuppose I hade both on my machine?
                            >>>>AADo I have some registry entry that did not get up dated from
                            >>>>the
                            >>>>2005
                            >>>>Ato the 2008 versions?
                            >>>>AAThanks for any help.
                            >>>>AAAn error has occurred while establishing a connection to the
                            >>>>server.
                            >>>>AWhen
                            >>>>Aconnecti ng to SQL Server 2005, this failure may be caused by the
                            >>>>fact
                            >>>>Athat
                            >>>>Aunder the default settings SQL Server does not allow remote
                            >>>>Aconnection s.
                            >>>>A(provide r: SQL Network Interfaces, error: 26 - Error Locating
                            >>>>AServer/Instance Specified)
                            >>>>ADescriptio n: An unhandled exception occurred during the
                            >>>>execution
                            >>>>of
                            >>>>Athe
                            >>>>Acurrent web request. Please review the stack trace for more
                            >>>>Ainformatio n
                            >>>>Aabout the error and where it originated in the code.
                            >>>>AExceptio n Details: System.Data.Sql Client.SqlExcep tion: An error
                            >>>>has
                            >>>>Aoccurred while establishing a connection to the server. When
                            >>>>Aconnecti ng to SQL Server 2005, this failure may be caused by the
                            >>>>fact
                            >>>>Athat under the default settings SQL Server does not allow remote
                            >>>>Aconnection s. (provider: SQL Network Interfaces, error: 26 -
                            >>>>Error
                            >>>>ALocating Server/Instance Specified)
                            >>>>AASource Error:
                            >>>>AALine 194: Using command As New
                            >>>>SqlCommand( "GetNonEmptyAlb ums",
                            >>>>Aconnection )
                            >>>>ALine 195: command.Command Type = CommandType.Sto redProcedure
                            >>>>ALine 196: connection.Open ()
                            >>>>ALine 197: Dim list As New Generic.List(Of Album)()
                            >>>>ALine 198: Using reader As SqlDataReader = command.Execute Reader
                            >>>>ASource File: I:\MyDocuments\ Visual Studio
                            >>>>A2008\WebSi tes\PersonalWeb Site1\App_Code\ PhotoManager.vb Line:
                            >>>>196
                            >>>>A>
                            >
                            >

                            Comment

                            Working...