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. Problem in connection

Problem in connection

Scheduled Pinned Locked Moved ASP.NET
helpquestion
11 Posts 3 Posters 2 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
    sajjadlashari
    wrote on last edited by
    #1

    Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?

    A C 2 Replies Last reply
    0
    • S sajjadlashari

      Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Did you written those code inside Try-Catch Block ? Could you please post those line of code ?

      cheers, Abhijit

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        Did you written those code inside Try-Catch Block ? Could you please post those line of code ?

        cheers, Abhijit

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

        I have written on load event of form where i am opening conncetion like con.open() on this line this error is acquiring An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Additional information: The ConnectionString property has not been initialized.

        A 1 Reply Last reply
        0
        • S sajjadlashari

          Dear All, I am working on a web site when i loading my web application the following error is acquiring i have written con in web.config file of web site and i am using OLEDB provider An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Kindly tell me what should i do?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Does this error happen locally, or just when deployed ? Perhaps it's that the deployed site can't see the database ?

          Christian Graus Driven to the arms of OSX by Vista.

          S 1 Reply Last reply
          0
          • S sajjadlashari

            I have written on load event of form where i am opening conncetion like con.open() on this line this error is acquiring An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code Additional information: The ConnectionString property has not been initialized.

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            sajjadlashari wrote:

            con.open() on this line this error is acquiring

            Yes, It seems the Issue is with your connection string. Please verify the connection string name, database Server Name, and User id and password.

            cheers, Abhijit

            S 1 Reply Last reply
            0
            • C Christian Graus

              Does this error happen locally, or just when deployed ? Perhaps it's that the deployed site can't see the database ?

              Christian Graus Driven to the arms of OSX by Vista.

              S Offline
              S Offline
              sajjadlashari
              wrote on last edited by
              #6

              I am working on standalone computer locally

              C 1 Reply Last reply
              0
              • S sajjadlashari

                I am working on standalone computer locally

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                OK, so when does the error occur ? Does any code run ?

                Christian Graus Driven to the arms of OSX by Vista.

                S 1 Reply Last reply
                0
                • A Abhijit Jana

                  sajjadlashari wrote:

                  con.open() on this line this error is acquiring

                  Yes, It seems the Issue is with your connection string. Please verify the connection string name, database Server Name, and User id and password.

                  cheers, Abhijit

                  S Offline
                  S Offline
                  sajjadlashari
                  wrote on last edited by
                  #8

                  I have checked it again every thing is alright i also connected with an other server but still is same problem. Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa" This is the line of code where error is acquiring.

                  A 1 Reply Last reply
                  0
                  • C Christian Graus

                    OK, so when does the error occur ? Does any code run ?

                    Christian Graus Driven to the arms of OSX by Vista.

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

                    yes when i run the code and try to debug the connection to verify connection on form load event then error is acquiring.

                    C 1 Reply Last reply
                    0
                    • S sajjadlashari

                      yes when i run the code and try to debug the connection to verify connection on form load event then error is acquiring.

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #10

                      OK - the first thing to do in this case, is to debug the code and work out what line blows up. The next, is to post the line and your connection string, etc., if you can't work out the issue.

                      Christian Graus Driven to the arms of OSX by Vista.

                      1 Reply Last reply
                      0
                      • S sajjadlashari

                        I have checked it again every thing is alright i also connected with an other server but still is same problem. Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa" This is the line of code where error is acquiring.

                        A Offline
                        A Offline
                        Abhijit Jana
                        wrote on last edited by
                        #11

                        sajjadlashari wrote:

                        Dim con As New OleDb.OleDbConnection con.ConnectionString = " DataSource = ABC; InitialCatalog = XYZ; Username = sa; Password = sa"

                        It should look like con.ConnectionString="Data Source=Database_Server_Name/IP;Initial Catalog=DataBase_Name;Integrated Security=True;User ID=UserID;Password=Password;" ;

                        cheers, Abhijit

                        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