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 Server does not exists or access denied

SQL Server does not exists or access denied

Scheduled Pinned Locked Moved Database
csharpdatabasehelpasp-netsql-server
11 Posts 5 Posters 1 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
    Sushant Duggal
    wrote on last edited by
    #1

    Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out. Regards,

    Sushant Duggal.

    S M 2 Replies Last reply
    0
    • S Sushant Duggal

      Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out. Regards,

      Sushant Duggal.

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      Paste your connection string here There may be some errors

      Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

      S 1 Reply Last reply
      0
      • S Sushant Duggal

        Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out. Regards,

        Sushant Duggal.

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

        Sushant Duggal wrote:

        Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out.

        Are you using Windows Authentication or SQL authentication If you are using Windows auth, ASP.NET runs under an ASP.NET user and so that user needs to have permissions to your database.

        Michael CP Blog [^] Development Blog [^]

        S 1 Reply Last reply
        0
        • S Sylvester george

          Paste your connection string here There may be some errors

          Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

          S Offline
          S Offline
          Sushant Duggal
          wrote on last edited by
          #4

          Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX

          Sushant Duggal.

          S A 2 Replies Last reply
          0
          • M Michael P Butler

            Sushant Duggal wrote:

            Hi friends, I am getting a strange error. I am working on .NET framework 1.1. When I work on a desktop application(C#.NET) and try to connect to SQL Server 2000 through my application, everything works fine and the connection is successfully established. But when I use the same database in web project(ASP.NET/C#), I am unable to connect to the database. I get an error: "SQL Server does not exists or access denied". I have carefully checked the connection string and everything in the code if perfect. Please help me out.

            Are you using Windows Authentication or SQL authentication If you are using Windows auth, ASP.NET runs under an ASP.NET user and so that user needs to have permissions to your database.

            Michael CP Blog [^] Development Blog [^]

            S Offline
            S Offline
            Sushant Duggal
            wrote on last edited by
            #5

            Hi, I am using SQL authentication. I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX Regards,

            Sushant Duggal.

            P 1 Reply Last reply
            0
            • S Sushant Duggal

              Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX

              Sushant Duggal.

              S Offline
              S Offline
              Sylvester george
              wrote on last edited by
              #6

              data source=XXX ? is it your local machine? What is the OS for database server ?

              Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

              S 1 Reply Last reply
              0
              • S Sylvester george

                data source=XXX ? is it your local machine? What is the OS for database server ?

                Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                S Offline
                S Offline
                Sushant Duggal
                wrote on last edited by
                #7

                No data source is not on my machine. I am working in a network. It was working fine 1 month ago. From last month I was working on a desktopn application. But now I opened my previous project (web project) ans I discovered the error.

                Sushant Duggal.

                S 1 Reply Last reply
                0
                • S Sushant Duggal

                  No data source is not on my machine. I am working in a network. It was working fine 1 month ago. From last month I was working on a desktopn application. But now I opened my previous project (web project) ans I discovered the error.

                  Sushant Duggal.

                  S Offline
                  S Offline
                  Sylvester george
                  wrote on last edited by
                  #8

                  I dont have anything more to suggest. Anyhow Please visit this link and try to solve your problem http://support.microsoft.com/kb/328306[^]

                  Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                  S 1 Reply Last reply
                  0
                  • S Sylvester george

                    I dont have anything more to suggest. Anyhow Please visit this link and try to solve your problem http://support.microsoft.com/kb/328306[^]

                    Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                    S Offline
                    S Offline
                    Sushant Duggal
                    wrote on last edited by
                    #9

                    Thanks for your effort Sylvester Regards,

                    Sushant Duggal.

                    1 Reply Last reply
                    0
                    • S Sushant Duggal

                      Hi, I am using SQL authentication. I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX Regards,

                      Sushant Duggal.

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #10

                      This is not an answer to your question, but rather a general comment. It is a bad idea to use the sa account as a general purpose access account. This account has special privileges which means that it can access and do things in your database that you really don't want to let outside users get access to. There is a security principle about reducing the attack surface which applies here. If you only want the login to be able to access stored procedures and perform C RUD functions, then you really should create a dedicated account for it and use this in the connection string instead. Sorry that I haven't answered your question, but I hope that this can help to remove what could end up being a security hole.

                      the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
                      Deja View - the feeling that you've seen this post before.

                      1 Reply Last reply
                      0
                      • S Sushant Duggal

                        Hi I am using the same connection string for two projects. One is desktop application and other is web application. Desktop application is working fine, database connectivity is fine whereas I am unable to connect in web application. Still I am writing the connection string for ur reference. user id=sa;password=XXX;data source=XXX;initial catalog=XXX

                        Sushant Duggal.

                        A Offline
                        A Offline
                        Aaron S
                        wrote on last edited by
                        #11

                        Below is the correct syntax for both Web.config and Code Behind files. Web.config: ------------------------------------------------------------------- ------------------------------------------------------------------- Code Behind in your Application (C# example): ------------------------------------------------------------------- using System.Data.SqlClient; using System.Configuration; namespace YourNameSpaceHere { public class YourWebPageNameHere : System.Web.UI.Page { public string strConnString1 private void Page_Load(object sender, System.EventArgs e) { strConnString1 = ConfigurationSettings.AppSettings["ConnectionString1"]; { } } ------------------------------------------------------------------- NOTE: Now you are able to reference this connection string throughout your code. Let me know if this helps, Aaron S. Power Base Media

                        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