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. SQL database works on IIS but not in client machines

SQL database works on IIS but not in client machines

Scheduled Pinned Locked Moved Database
databasecsharpasp-netsql-serversysadmin
7 Posts 4 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
    saud_a_k
    wrote on last edited by
    #1

    I have a ASP.NET website it is hosted on IIS 5 and it works fine' I can browse from IIS console itself but when I open the same in another client machine, I see the page but no database it says [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. I checked the named pipes and tcp/ip on sql server and all the permissions are enabled' I cant find why it shows up on the server but not on the client plz hlp

    _____________________________________________________ Yea! I could be wrong...

    R G 2 Replies Last reply
    0
    • S saud_a_k

      I have a ASP.NET website it is hosted on IIS 5 and it works fine' I can browse from IIS console itself but when I open the same in another client machine, I see the page but no database it says [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. I checked the named pipes and tcp/ip on sql server and all the permissions are enabled' I cant find why it shows up on the server but not on the client plz hlp

      _____________________________________________________ Yea! I could be wrong...

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      can you provide code.., how you are conneting to the database..,

      Rajesh B --> A Simple Programmer <--

      S 1 Reply Last reply
      0
      • R Rajesh Anuhya

        can you provide code.., how you are conneting to the database..,

        Rajesh B --> A Simple Programmer <--

        S Offline
        S Offline
        saud_a_k
        wrote on last edited by
        #3

        I do not have the code for this application it uses an XML file where i have to give the connection details like <Connection Name="Provider" Value="1" /> <Connection Name="Server" Value="server" /> <Connection Name="Database" Value="db" /> <Connection Name="UserID" Value="user" /> <Connection Name="Password" Value="pwd" /> I do not know how the application uses this is it a connection problem then so it should not work on the server I think...

        _____________________________________________________ Yea! I could be wrong...

        L 1 Reply Last reply
        0
        • S saud_a_k

          I do not have the code for this application it uses an XML file where i have to give the connection details like <Connection Name="Provider" Value="1" /> <Connection Name="Server" Value="server" /> <Connection Name="Database" Value="db" /> <Connection Name="UserID" Value="user" /> <Connection Name="Password" Value="pwd" /> I do not know how the application uses this is it a connection problem then so it should not work on the server I think...

          _____________________________________________________ Yea! I could be wrong...

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

          saud_a_k wrote:

          <Connection Name="UserID" Value="user" /> <Connection Name="Password" Value="pwd" />

          I'm not sure whether the sa-account is enabled by default, and it might even be that 'mixed mode authentication' is disabled. Create a new console-application, somewhat similar to this;

          using System;
          using System.Data.SqlClient;

          static class SqlTester
          {
          public static int Main (string[] args)
          {
          using (SqlConnection con = new SqlConnection(args[0])
          {
          try
          {
          con.Open ();
          Console.WriteLine ("Connected succesfull, your ConnectionString is correct :)");
          }
          catch (Exception ex)
          {
          Console.WriteLine ("Something went wrong:\n" + ex.ToString ());
          }
          }
          }
          }

          That would give you a small console app that you can use to verify the connection-details. In this specific case, check whether the customers server have;

          • an account with given UserID (should be in the same place as the 'sa')
          • allowed mixed mode access (not just Windows-authentication)
          • whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)

          Good luck :)

          I are Troll :suss:

          S 1 Reply Last reply
          0
          • L Lost User

            saud_a_k wrote:

            <Connection Name="UserID" Value="user" /> <Connection Name="Password" Value="pwd" />

            I'm not sure whether the sa-account is enabled by default, and it might even be that 'mixed mode authentication' is disabled. Create a new console-application, somewhat similar to this;

            using System;
            using System.Data.SqlClient;

            static class SqlTester
            {
            public static int Main (string[] args)
            {
            using (SqlConnection con = new SqlConnection(args[0])
            {
            try
            {
            con.Open ();
            Console.WriteLine ("Connected succesfull, your ConnectionString is correct :)");
            }
            catch (Exception ex)
            {
            Console.WriteLine ("Something went wrong:\n" + ex.ToString ());
            }
            }
            }
            }

            That would give you a small console app that you can use to verify the connection-details. In this specific case, check whether the customers server have;

            • an account with given UserID (should be in the same place as the 'sa')
            • allowed mixed mode access (not just Windows-authentication)
            • whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)

            Good luck :)

            I are Troll :suss:

            S Offline
            S Offline
            saud_a_k
            wrote on last edited by
            #5

            Eddy Vluggen wrote:

            an account with given UserID (should be in the same place as the 'sa') allowed mixed mode access (not just Windows-authentication) whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)

            I checked all these options but I still get the same error I also gave the location of another server but still the page shows up on the server but not on the client

            _____________________________________________________ Yea! I could be wrong...

            L 1 Reply Last reply
            0
            • S saud_a_k

              Eddy Vluggen wrote:

              an account with given UserID (should be in the same place as the 'sa') allowed mixed mode access (not just Windows-authentication) whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)

              I checked all these options but I still get the same error I also gave the location of another server but still the page shows up on the server but not on the client

              _____________________________________________________ Yea! I could be wrong...

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

              saud_a_k wrote:

              I checked all these options but I still get the same error

              Try the connectionstring below, with the console-application from the previous post;

              Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

              If that fails to connect, you'd at least have a more decent error-message to hunt for.

              saud_a_k wrote:

              I also gave the location of another server but still the page shows up on the server but not on the client

              If the above method also fails, chances are that there's a connectivity-problem. That means checking if you can 'ping' the clients' server, validating the firewalls and so on. If it's not a connectivity-problem, (security-related problems) then the console-app would generate an error-message indicating where the problem is.

              I are Troll :suss:

              1 Reply Last reply
              0
              • S saud_a_k

                I have a ASP.NET website it is hosted on IIS 5 and it works fine' I can browse from IIS console itself but when I open the same in another client machine, I see the page but no database it says [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. I checked the named pipes and tcp/ip on sql server and all the permissions are enabled' I cant find why it shows up on the server but not on the client plz hlp

                _____________________________________________________ Yea! I could be wrong...

                G Offline
                G Offline
                G Tek
                wrote on last edited by
                #7

                I'm assuming that the IIS is hosted on the same server as the SQL db? If so, it's making a local connection whereas clients are connecting over the network - based on this make sure that: 1) you have SQL configured to allow the type of connection you are trying to use from the client (IP, pipes, etc.) 2) you have the firewall configured to allow SQL traffic (I've had this problem in the past where the MS firewall didn't automatically add a rule for SQL) Those are my initial thoughts.

                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