473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Re: Combobox Load Help Please

On Fri, 25 Jul 2008 07:54:06 -0700, Phill
<Ph***@discussions.microsoft.comwrote:
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
Jul 25 '08 #1
2 1018
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
<Ph***@discussions.microsoft.comwrote:
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
Jul 25 '08 #2
On Fri, 25 Jul 2008 10:30:19 -0700, Phill
<Ph***@discussions.microsoft.comwrote:
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.
Jul 25 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Wengert | last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item to be "Make a Selection" and the following items will be names from a table in my DB (See code below). When I run the...
2
by: Phil | last post by:
My form uses a dataset containing two tables, a base table (Contact) and a lookup table (Insurer). My combobox is bound as follows: DataSource = datasetContact DisplayMember =...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
4
by: Vish | last post by:
Hi, I am having a problem with my form being too slow to load up. I have a 4-5 of comboboxes on the form that load a lot (~30,000 records) into them. So this is causing a lot delay (5-6 seconds)...
6
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.