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. General Programming
  3. C#
  4. SQL server connection string issue :-(

SQL server connection string issue :-(

Scheduled Pinned Locked Moved C#
databasecsharpc++htmlsql-server
6 Posts 5 Posters 6 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.
  • N Offline
    N Offline
    Nish Nishant
    wrote on last edited by
    #1

    This is my conn string :- server=Earth;database=Test;uid=Nish;pwd=nish123 Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish


    Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

    M J H 3 Replies Last reply
    0
    • N Nish Nishant

      This is my conn string :- server=Earth;database=Test;uid=Nish;pwd=nish123 Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish


      Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Does adding Integrated Security=false make a difference? I only ever use Windows Authentication, but according to MSDN Integrated Security -or- Trusted_Connection 'false' When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true. Michael 'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in Space

      N 1 Reply Last reply
      0
      • M Michael P Butler

        Does adding Integrated Security=false make a difference? I only ever use Windows Authentication, but according to MSDN Integrated Security -or- Trusted_Connection 'false' When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true. Michael 'Logic, my dear Zoe, merely enables one to be wrong with authority.' - The Doctor: The Wheel in Space

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #3

        Michael P Butler wrote: Does adding Integrated Security=false make a difference? :( Nope I added it to the conn string - but I get the same error. Nish


        Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

        A 1 Reply Last reply
        0
        • N Nish Nishant

          Michael P Butler wrote: Does adding Integrated Security=false make a difference? :( Nope I added it to the conn string - but I get the same error. Nish


          Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

          A Offline
          A Offline
          apferreira
          wrote on last edited by
          #4

          Have you tried this at the command prompt? This solved a similar connection problem on my computer. osql -E -S (local)\DBNAME -Q "sp_grantlogin 'MACHINENAME\ACCOUNTNAME'" osql -E -S (local)\DBNAME -d Pubs -Q "sp_grantdbaccess 'MACHINENAME\ACCOUNTNAME'" osql -E -S (local)\DBNAME -d Pubs -Q "sp_addrolemember 'db_owner', 'MACHINENAME\ACCOUNTNAME'" Substitute elements in UPPERCASE with the relevant informantion from your specific case. Note: Contrary to you, I was using Windows Authentication instead of SQL Server Authentication.

          1 Reply Last reply
          0
          • N Nish Nishant

            This is my conn string :- server=Earth;database=Test;uid=Nish;pwd=nish123 Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish


            Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

            J Offline
            J Offline
            Jeff Varszegi
            wrote on last edited by
            #5

            Nish, I apologize in advance if anything I say is stupid. I've never used SQL Server with Windows authentication at all. In Enterprise Manager, go to your server, then Security - Logins. Right-click on the user in question and bring up the properties. Does it look like the user is set up to only use SQL Server authentication? Now, is the Test database set up so that it only accepts trusted Windows-authenticated user connections? Also, is it possible to add the user to the BUILTIN\Administrators group as a troubleshooting step? Thank you. Jeff Varszegi

            1 Reply Last reply
            0
            • N Nish Nishant

              This is my conn string :- server=Earth;database=Test;uid=Nish;pwd=nish123 Nish is a SQL server db user I added for the Test database using Enterprise Manager (today is the first I am seeign this weird app) It says :- Login failed for use Nish; Reason: Not associated with a trusted sql server connection Damnit that sucks. The sql server is running on this same machine (earth) I am usiong System.Data.SqlClient.SqlConnection Nish


              Extending MFC Applications with the .NET Framework [NW] (coming soon...) Summer Love and Some more Cricket [NW] (My first novel) Shog's review of SLASMC [NW] This post was made from Trivandrum city, India on a 0.0001 KB/s net connection

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              Try this: Data Source=Earth; Initial Catalog=Test; User ID=Nish; Password=nish123; Integrated Security=false

              -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

              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