XXXXXX not available in this context.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • doofy

    XXXXXX not available in this context.

    I'm trying to create a custom control which would be a treeview which
    populates itself with table and field details from a database.

    I need to be able to call up a form to enter the server/db information.

    I created a form within the custom control, and I sort of thought it
    might not work, and it isn't.

    It's telling me "frmConnect " is not available in this context.

    Any ideas what is causing this?
  • Peter Duniho

    #2
    Re: XXXXXX not available in this context.

    On Sun, 24 Feb 2008 19:53:47 -0800, doofy <nope@notme.com wrote:
    [...]
    It's telling me "frmConnect " is not available in this context.
    >
    Any ideas what is causing this?
    Since you didn't post any code at all, it's pretty much impossible to say
    for sure. But presumably you are using the identifier "frmConnect " in a
    context in which it's not available.

    Whatever that identifier is, you need to make sure you're using it in a
    way that makes sense.

    If you'd like to post some code, then some advice as to what "makes sense"
    can be offered. Otherwise, your question is far too vague to be answered.

    Pete

    Comment

    • doofy

      #3
      Re: XXXXXX not available in this context.

      Peter Duniho wrote:
      On Sun, 24 Feb 2008 19:53:47 -0800, doofy <nope@notme.com wrote:
      >
      >[...]
      >It's telling me "frmConnect " is not available in this context.
      >>
      >Any ideas what is causing this?
      >
      >
      Since you didn't post any code at all, it's pretty much impossible to
      say for sure. But presumably you are using the identifier "frmConnect "
      in a context in which it's not available.
      >
      Whatever that identifier is, you need to make sure you're using it in a
      way that makes sense.
      >
      If you'd like to post some code, then some advice as to what "makes
      sense" can be offered. Otherwise, your question is far too vague to be
      answered.
      >
      Pete
      Sorry about that. I thought maybe it was a generalized question. The
      code's on another machine.

      private void connectToDBTool StripMenuItem_C Lick(blah blah blah)
      {
      frmConnect.Show ();
      }

      frmConnect is a form that is within the custom control environment.

      Is more code than that needed? If so, I'll have to wait until later.

      I have showing a treeview, a context menu on right click of the tree
      view, and I'm calling this form from the menu to input the connection
      string parameters.

      Comment

      • doofy

        #4
        Re: XXXXXX not available in this context.

        doofy wrote:
        >
        it is. It's in another namespace too. I just told it to add a form to
        the project, and that's what it did.
        I made it work by preceding the object name with the other namespace
        name, and by instantiating it with "new".

        Thanks for everyone's help in jogging my brain in the right direction.

        Comment

        Working...