Re: Combobox Load Help Please

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

    Re: Combobox Load Help Please

    On Fri, 25 Jul 2008 07:54:06 -0700, Phill
    <Phill@discussi ons.microsoft.c omwrote:
    Thanks for the reply. That is what I am trying to do. I guess I don't
    have
    anonymous type support because it doesn't like the syntax for this:
    var item = new { Type_ID = rdr[0], Type = rdr[1] };
    says Type is expected. I'm using VS 2005, target is Pocket PC. Is there
    another way to do it?
    Sure, just write a named class to do the same thing. The anonymous class
    just allows you to not litter your code with little class declarations,
    but there's no reason you can't write the class explicitly instead.

    Pete
  • =?Utf-8?B?UGhpbGw=?=

    #2
    Re: Combobox Load Help Please

    I tried that, but when I tried to go to the design view of the form it said I
    could only have 1 class in the form.

    "Peter Duniho" wrote:
    On Fri, 25 Jul 2008 07:54:06 -0700, Phill
    <Phill@discussi ons.microsoft.c omwrote:
    >
    Thanks for the reply. That is what I am trying to do. I guess I don't
    have
    anonymous type support because it doesn't like the syntax for this:
    var item = new { Type_ID = rdr[0], Type = rdr[1] };
    says Type is expected. I'm using VS 2005, target is Pocket PC. Is there
    another way to do it?
    >
    Sure, just write a named class to do the same thing. The anonymous class
    just allows you to not litter your code with little class declarations,
    but there's no reason you can't write the class explicitly instead.
    >
    Pete
    >

    Comment

    • Peter Duniho

      #3
      Re: Combobox Load Help Please

      On Fri, 25 Jul 2008 10:30:19 -0700, Phill
      <Phill@discussi ons.microsoft.c omwrote:
      I tried that, but when I tried to go to the design view of the form it
      said I
      could only have 1 class in the form.
      I doubt that's the exact error you got. More likely, it complained that
      you could only have one top-level class in the .cs file (or possibly that
      the Form sub-class has to be the first top-level class...I forget the
      exact requirement).

      Declare the class as a nested class _inside_ your Form class. It should
      work fine.

      Comment

      Working...