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. Web Development
  3. ASP.NET
  4. connection string problem

connection string problem

Scheduled Pinned Locked Moved ASP.NET
securityhelpsysadmin
11 Posts 7 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.
  • M m dhu

    im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();

    SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");

    i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

    modified on Tuesday, December 1, 2009 6:46 AM

    A Offline
    A Offline
    Abhishek Sur
    wrote on last edited by
    #2

    Just remove Use Procedure for Prepare=1; from the connectionstring. Refer to www.connectionstrings.com[^] for writing your connectionstring.

    Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


    My Latest Articles-->** Simplify Code Using NDepend
    Basics of Bing Search API using .NET
    Microsoft Bing MAP using Javascript

    1 Reply Last reply
    0
    • M m dhu

      im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();

      SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");

      i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

      modified on Tuesday, December 1, 2009 6:46 AM

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #3

      If i'm not wrong you will only need this part of your connection string to connect to the database "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;" All other information is not necessary. Just try with this! I would also suggest you to use Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties.

      M 1 Reply Last reply
      0
      • D Dinesh Mani

        If i'm not wrong you will only need this part of your connection string to connect to the database "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;" All other information is not necessary. Just try with this! I would also suggest you to use Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties.

        M Offline
        M Offline
        m dhu
        wrote on last edited by
        #4

        i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

        D T S 3 Replies Last reply
        0
        • M m dhu

          i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

          D Offline
          D Offline
          Dinesh Mani
          wrote on last edited by
          #5

          Try to manually register the server on the Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. BTW, are you sure if Windows authentication is enabled on the database?

          M 1 Reply Last reply
          0
          • D Dinesh Mani

            Try to manually register the server on the Server Explorer to connect to the database to test the connectivity. You have a wizard there to help you and at the end of it you can get the connection string from the registered server's properties. BTW, are you sure if Windows authentication is enabled on the database?

            M Offline
            M Offline
            m dhu
            wrote on last edited by
            #6

            Dinesh Mani wrote:

            Try to manually register the server on the Server Explorer

            i did it and connection is successful there... but still same error....

            Dinesh Mani wrote:

            are you sure if Windows authentication is enabled

            windows authentication is enabled..

            D 1 Reply Last reply
            0
            • M m dhu

              Dinesh Mani wrote:

              Try to manually register the server on the Server Explorer

              i did it and connection is successful there... but still same error....

              Dinesh Mani wrote:

              are you sure if Windows authentication is enabled

              windows authentication is enabled..

              D Offline
              D Offline
              Dinesh Mani
              wrote on last edited by
              #7

              Did you check the resultant connection string from the Server registration? You can get it by accessing the properties of the server. Try using that from your code. If possible try to generate a dataset/datatable using the Visual Studio wizards and check if you are able to connect and fetch data from the code.

              1 Reply Last reply
              0
              • M m dhu

                i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

                T Offline
                T Offline
                The Man from U N C L E
                wrote on last edited by
                #8

                So, is 'NT AUTHORITY\NETWORK SERVICE' listed in SQL Management Studio as one of the users with access to the database? I guess not.

                If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

                S 1 Reply Last reply
                0
                • M m dhu

                  i tried actually this is the error im getting... Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

                  S Offline
                  S Offline
                  S Brozius
                  wrote on last edited by
                  #9

                  What user do you use to check with Server Explorer if the connectionstring is valid? Looks like an authorization-issue to me... If it is a service, try running it under another account.

                  Nah... What's up, Doc? CCC's solved : 1

                  1 Reply Last reply
                  0
                  • M m dhu

                    im using vs2003 and sql2000 im getting error in connection string..... Keyword not supported: 'use procedure for prepare'. Line 51: { Line 52: string str= "select * from table1"; Line 53: SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False"); Line 54: SqlCommand cmd=new SqlCommand(str,cnn); Line 55: DataSet ds=new DataSet();

                    SqlConnection cnn=new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=new;Data Source=NETZOOM;Use Procedure for Prepare=1;Packet Size=4096;Workstation ID=NETZOOM;Use Encryption for Data=false;Tag with column collation when possible=False");

                    i tried by removing that keywords still this error Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

                    modified on Tuesday, December 1, 2009 6:46 AM

                    V Offline
                    V Offline
                    Vimalsoft Pty Ltd
                    wrote on last edited by
                    #10

                    Good Day i can Help. First your Connection is not Correct it has to be done this way

                    SqlConnection cnn=new SqlConnection("Initial Catalog=new;Data Source=NETZOOM;Initial Catalog=NETZOOM User ID=sa;Password=mypassword");

                    now here is the Problem you might not have a sa password. I see above you want to use WindowsAuthontication. Create a SQL Account and use it for your Application.

                    Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

                    1 Reply Last reply
                    0
                    • T The Man from U N C L E

                      So, is 'NT AUTHORITY\NETWORK SERVICE' listed in SQL Management Studio as one of the users with access to the database? I guess not.

                      If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

                      S Offline
                      S Offline
                      souidi abderrahman
                      wrote on last edited by
                      #11

                      try to get the connexion string from the database properties and test it then put it in your code :zzz:

                      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