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. General Programming
  3. C#
  4. connection problem

connection problem

Scheduled Pinned Locked Moved C#
help
5 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.
  • J Offline
    J Offline
    jadhavShubhangi
    wrote on last edited by
    #1

    hi......... i have written code in windows application as follows app.config program.cs string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString); but it gives error like 1. The name ConfigurationManager Des not exist. pls help me.......

    K L 2 Replies Last reply
    0
    • J jadhavShubhangi

      hi......... i have written code in windows application as follows app.config program.cs string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString); but it gives error like 1. The name ConfigurationManager Des not exist. pls help me.......

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      Now this is a properly worded question, you have givens us some code, and told us what is wrong. You still need to add the <pre> tags though. 1) You need to reference the System.Configuration dll in your project. (Right click "References", "Add Reference", select the ".Net" tab then select System.Configuration in the list and OK it. 2) Add using System.Configuration; to the top of the file containing your class.

      Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.

      J 1 Reply Last reply
      0
      • K Keith Barrow

        Now this is a properly worded question, you have givens us some code, and told us what is wrong. You still need to add the <pre> tags though. 1) You need to reference the System.Configuration dll in your project. (Right click "References", "Add Reference", select the ".Net" tab then select System.Configuration in the list and OK it. 2) Add using System.Configuration; to the top of the file containing your class.

        Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.

        J Offline
        J Offline
        jadhavShubhangi
        wrote on last edited by
        #3

        Thanks a lot....... this will run but their is an another error is 1.a field initializer can not reference the non static field ,method,property,"EmpDetails.form.conString" code is: string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString);

        L 1 Reply Last reply
        0
        • J jadhavShubhangi

          hi......... i have written code in windows application as follows app.config program.cs string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString); but it gives error like 1. The name ConfigurationManager Des not exist. pls help me.......

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

          I have a suggestion for you, buy a C# book, learn it first, write some "Hello World" until you know the c# language. Then you can try to write something with database. Don't just copy paste codes, because it will not work.

          1 Reply Last reply
          0
          • J jadhavShubhangi

            Thanks a lot....... this will run but their is an another error is 1.a field initializer can not reference the non static field ,method,property,"EmpDetails.form.conString" code is: string conString = ConfigurationManager.ConnectionStrings["Employee.Properties.Settings.EmpdetailsConnectionString"].ConnectionString; SqlConnection con = new SqlConnection(conString);

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Hi, I suggest you move the assignments (conString and con) to the Form's Load handler. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


            I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


            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