Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Can not connect to my database from asp .net application

Can not connect to my database from asp .net application

Scheduled Pinned Locked Moved Database
databasecsharpjsonhelp
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephen Holdorf
    wrote on last edited by
    #1

    I have a named instance of 2008 r2 located on my windows 7 professional local machine. I have tried to get my connect string to work but I just cant. I am using machine name "HOLDORF-PC" SQL instance name "SQL_2008_R2" and the rest of the connection string. Here is my connection string: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel" providerName="System.Data.SqlClient" /> Please help Steve Holdorf

    L B Richard DeemingR H 4 Replies Last reply
    0
    • S Stephen Holdorf

      I have a named instance of 2008 r2 located on my windows 7 professional local machine. I have tried to get my connect string to work but I just cant. I am using machine name "HOLDORF-PC" SQL instance name "SQL_2008_R2" and the rest of the connection string. Here is my connection string: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel" providerName="System.Data.SqlClient" /> Please help Steve Holdorf

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The CS does not say whether you want to use mixed mode or windows authentication. There's examples here[^].

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      S 1 Reply Last reply
      0
      • L Lost User

        The CS does not say whether you want to use mixed mode or windows authentication. There's examples here[^].

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        S Offline
        S Offline
        Stephen Holdorf
        wrote on last edited by
        #3

        I tried this: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel; Integrated Security=SSPI" providerName="System.Data.SqlClient" and it still does not work?

        S 1 Reply Last reply
        0
        • S Stephen Holdorf

          I tried this: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel; Integrated Security=SSPI" providerName="System.Data.SqlClient" and it still does not work?

          S Offline
          S Offline
          Stephen Holdorf
          wrote on last edited by
          #4

          Sorry, I tried this: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel; Integrated Security=True" and it still doesn't work. One point is that this is the connection string that coexists with my Entity Framework model.

          S 1 Reply Last reply
          0
          • S Stephen Holdorf

            Sorry, I tried this: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel; Integrated Security=True" and it still doesn't work. One point is that this is the connection string that coexists with my Entity Framework model.

            S Offline
            S Offline
            Stephen Holdorf
            wrote on last edited by
            #5

            OK. I think you were right on the DB connection string. Now, I'm getting this error: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. Here is my Entity Framework connection string: And here is my Model connections:

            L J 2 Replies Last reply
            0
            • S Stephen Holdorf

              OK. I think you were right on the DB connection string. Now, I'm getting this error: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. Here is my Entity Framework connection string: And here is my Model connections:

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I don't use EF; I've no idea what it epects beyond a normal SQL-server connection string. According to MSDN[^] your string looks correct.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              • S Stephen Holdorf

                OK. I think you were right on the DB connection string. Now, I'm getting this error: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. Here is my Entity Framework connection string: And here is my Model connections:

                J Offline
                J Offline
                Jorgen Andersson
                wrote on last edited by
                #7

                lholdorf wrote:

                Check the inner exceptions for details and ensure that the connection string is correct.

                This is a good time to post the inner exceptions.

                Wrong is evil and must be defeated. - Jeff Ello[^]

                1 Reply Last reply
                0
                • S Stephen Holdorf

                  I have a named instance of 2008 r2 located on my windows 7 professional local machine. I have tried to get my connect string to work but I just cant. I am using machine name "HOLDORF-PC" SQL instance name "SQL_2008_R2" and the rest of the connection string. Here is my connection string: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel" providerName="System.Data.SqlClient" /> Please help Steve Holdorf

                  B Offline
                  B Offline
                  Bernhard Hiller
                  wrote on last edited by
                  #8

                  Where does your asp.net application run - on the same machine? If not, configure the SQL Server to accept connections from other machines. And what about the account the IIS is running with? Does that account have sufficient access rights to the database? I suggest SQL Server authentication instead of WIndows authentication - do not forget to configure your SQL Server to allow that.

                  1 Reply Last reply
                  0
                  • S Stephen Holdorf

                    I have a named instance of 2008 r2 located on my windows 7 professional local machine. I have tried to get my connect string to work but I just cant. I am using machine name "HOLDORF-PC" SQL instance name "SQL_2008_R2" and the rest of the connection string. Here is my connection string: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel" providerName="System.Data.SqlClient" /> Please help Steve Holdorf

                    Richard DeemingR Offline
                    Richard DeemingR Offline
                    Richard Deeming
                    wrote on last edited by
                    #9

                    lholdorf wrote:

                    HOLDORF-PC\\SQL_2008_R2

                    Is the double back-slash between the machine name and the instance name a typo in your question, or a mistake in copying the connection string from a C# source file to the web.config file?


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                    1 Reply Last reply
                    0
                    • S Stephen Holdorf

                      I have a named instance of 2008 r2 located on my windows 7 professional local machine. I have tried to get my connect string to work but I just cant. I am using machine name "HOLDORF-PC" SQL instance name "SQL_2008_R2" and the rest of the connection string. Here is my connection string: "Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel" providerName="System.Data.SqlClient" /> Please help Steve Holdorf

                      H Offline
                      H Offline
                      Hemant Singh Rautela
                      wrote on last edited by
                      #10

                      I think you have to provide user name and password also...! I used As : Database Connection[^]

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups