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. Visual Studio
  4. Developer studio woes

Developer studio woes

Scheduled Pinned Locked Moved Visual Studio
helpdatabasevisual-studiodockercollaboration
3 Posts 2 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.
  • L Offline
    L Offline
    lemur
    wrote on last edited by
    #1

    Hi, any pointers here would be highly appreciated. I'm refactoring part of a dialog box into a UserControl so that it can be used from another dialog. Nothing fancy there. My problem is that when the control loads, it populates its own sub-controls using data read from a database. The connection string for the database is read from the application's config file. This means that when you place the control from the toolbox onto another dialog, VS (2005 team edition) gives an error as it can't find the connection string (in its own config file!). I can work round this by adding all of the initialisation code into a function that is called by the control's container during construction. However, its not the easiest and cleanest interface to my control and I'm sure there must be a neater way of doing this that I'm just not spotting, e.g. a method override that's an appropriate place, or labelling the configuration method with a DevStudio attribute so that the configuration method doesnt get called? Maybe there's a better way of tackling the whole configuration problem? Anyway, thanks v. much for any help ou can give. Kev

    R 1 Reply Last reply
    0
    • L lemur

      Hi, any pointers here would be highly appreciated. I'm refactoring part of a dialog box into a UserControl so that it can be used from another dialog. Nothing fancy there. My problem is that when the control loads, it populates its own sub-controls using data read from a database. The connection string for the database is read from the application's config file. This means that when you place the control from the toolbox onto another dialog, VS (2005 team edition) gives an error as it can't find the connection string (in its own config file!). I can work round this by adding all of the initialisation code into a function that is called by the control's container during construction. However, its not the easiest and cleanest interface to my control and I'm sure there must be a neater way of doing this that I'm just not spotting, e.g. a method override that's an appropriate place, or labelling the configuration method with a DevStudio attribute so that the configuration method doesnt get called? Maybe there's a better way of tackling the whole configuration problem? Anyway, thanks v. much for any help ou can give. Kev

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Hi, do you mean something like this?

      if (!base.DesignMode) {
      //initialize
      }

      Robert

      L 1 Reply Last reply
      0
      • R Robert Rohde

        Hi, do you mean something like this?

        if (!base.DesignMode) {
        //initialize
        }

        Robert

        L Offline
        L Offline
        lemur
        wrote on last edited by
        #3

        Hi, sorry for not replying earlier - this is perfect, thanks. I know, pretty obvious - just wasn't spotting it or searching with the correct terms. Cheers, Kev

        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