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. Please Heeelp - connection error driving me crazy

Please Heeelp - connection error driving me crazy

Scheduled Pinned Locked Moved Database
helpcsharpdatabasesql-servervisual-studio
4 Posts 2 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.
  • C Offline
    C Offline
    ComCoderCsharp
    wrote on last edited by
    #1

    Hi guys I'm working in Visual studio on a website and using ADO.NET to connect to my pubs sql-database. I keep on getting error messages when I test the website in my browser. Is there anyone who can tell me what could be wrong - I've been through all the configurations steps e.g setting the remote connections... at least I think so... I've gotten error messages like "login failure" and "The user is not associated with a trusted SQL Server connection" what might be wrong??????????? The strange thing is that if I chooe e.g. a gridview from the toolbox there is no problem at all for this autogenerated gridview to connect to the server - how can this be? - I've tried to use the autogenerated connection string from the toolbox gridview, but that doesn't seem to help... her is some connection string that I have tried out string CONN_STRING = "Server=.\\SQLEXPRESS;Initial Catalog=pubs;Integrated Security=SSPI"; or string CONN_STRING = "Server=.\\SQLEXPRESS;Initial Catalog=pubs;uid=sa;pwd="; please someone help me... All the best Al

    C 1 Reply Last reply
    0
    • C ComCoderCsharp

      Hi guys I'm working in Visual studio on a website and using ADO.NET to connect to my pubs sql-database. I keep on getting error messages when I test the website in my browser. Is there anyone who can tell me what could be wrong - I've been through all the configurations steps e.g setting the remote connections... at least I think so... I've gotten error messages like "login failure" and "The user is not associated with a trusted SQL Server connection" what might be wrong??????????? The strange thing is that if I chooe e.g. a gridview from the toolbox there is no problem at all for this autogenerated gridview to connect to the server - how can this be? - I've tried to use the autogenerated connection string from the toolbox gridview, but that doesn't seem to help... her is some connection string that I have tried out string CONN_STRING = "Server=.\\SQLEXPRESS;Initial Catalog=pubs;Integrated Security=SSPI"; or string CONN_STRING = "Server=.\\SQLEXPRESS;Initial Catalog=pubs;uid=sa;pwd="; please someone help me... All the best Al

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      ComCoderCsharp wrote:

      how can this be?

      Because Visual Studio is running in your account. The web application is running in the ASPNET account - You have to tell SQL Server about this by adding ASPNET as a windows authenticated login and giving it permission to use the appropriate database.


      Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

      C 1 Reply Last reply
      0
      • C Colin Angus Mackay

        ComCoderCsharp wrote:

        how can this be?

        Because Visual Studio is running in your account. The web application is running in the ASPNET account - You have to tell SQL Server about this by adding ASPNET as a windows authenticated login and giving it permission to use the appropriate database.


        Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

        C Offline
        C Offline
        ComCoderCsharp
        wrote on last edited by
        #3

        Hi thanks for the reply Maybe this could be the solution.. but it leads me to another question: How do I add windows authenticated login and give permission to the appropriate database, I can't seem to figure it out...sorry if this is a stupid question, I'm kind of new to configuring the database connections... Thanks in advance Al

        C 1 Reply Last reply
        0
        • C ComCoderCsharp

          Hi thanks for the reply Maybe this could be the solution.. but it leads me to another question: How do I add windows authenticated login and give permission to the appropriate database, I can't seem to figure it out...sorry if this is a stupid question, I'm kind of new to configuring the database connections... Thanks in advance Al

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          In SQL Server 2000 use the Enterprise manage. In the security tab for the server you can add the log in. In the users tab for the individual database you can then set up access to the database and the objects it contains. In SQL Server 2005 there will be a similar mechanism in the SQL Server Management Studio.


          Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

          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