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. SQLDMO for SQL Server 2000

SQLDMO for SQL Server 2000

Scheduled Pinned Locked Moved Database
csharphelpquestiondatabasesql-server
3 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.
  • U Offline
    U Offline
    usernamed
    wrote on last edited by
    #1

    Firstly, I apologise if this is the wrong group to post in, my problem involves technologies covered in three different groups. C# is the language, .NET 2.0 is the platform, SQL Server is the DBMS. I'm developing on my local machine and have a named instance of SQL Server running. I'm trying to connect to the instance of SQL Server using SQLDMO (because I want the connection to return a list of all the databases available on that server, and SQLDMO seems the best way of doing it) My user account is set up as a trusted connection via Enterprise Manager, but I'm unable to log onto the server. The app returns an error message of: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'foo' The code in question looks like: SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass(); srv.Connect(this.cmbServer.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text); I have also tried connecting without providing username or password details, but have had the same result. Any ideas?

    C 1 Reply Last reply
    0
    • U usernamed

      Firstly, I apologise if this is the wrong group to post in, my problem involves technologies covered in three different groups. C# is the language, .NET 2.0 is the platform, SQL Server is the DBMS. I'm developing on my local machine and have a named instance of SQL Server running. I'm trying to connect to the instance of SQL Server using SQLDMO (because I want the connection to return a list of all the databases available on that server, and SQLDMO seems the best way of doing it) My user account is set up as a trusted connection via Enterprise Manager, but I'm unable to log onto the server. The app returns an error message of: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'foo' The code in question looks like: SQLDMO.SQLServer srv = new SQLDMO.SQLServerClass(); srv.Connect(this.cmbServer.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text); I have also tried connecting without providing username or password details, but have had the same result. Any ideas?

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

      usernamed wrote:

      srv.Connect(this.cmbServer.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text);

      If you are using Windows Authentication why are you passing a user name and password? With Windows Authentication your credentials are passed automatically, this is sending a specific username and password which SQL Server will interpret as being for a SQL Server Account (not a windows account). ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

      U 1 Reply Last reply
      0
      • C Colin Angus Mackay

        usernamed wrote:

        srv.Connect(this.cmbServer.SelectedItem.ToString(),this.txtUser.Text,this.txtPassword.Text);

        If you are using Windows Authentication why are you passing a user name and password? With Windows Authentication your credentials are passed automatically, this is sending a specific username and password which SQL Server will interpret as being for a SQL Server Account (not a windows account). ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

        U Offline
        U Offline
        usernamed
        wrote on last edited by
        #3

        Hi Colin, Thanks for responding. I should have written in my initial post that I'd tried not passing a username or password, but was getting the following error: No overload for method 'Connect' takes '1' arguments(CS1501) As such, I thought that the Connect Method forced me to put in a username and password, even if they shouldn't be required.

        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