Hashtable initialization

T

tshad

In VS 2005, is there a way to create and initialize a hashtable in one
statement?

Something like (I know this isn't correct):

public static Hashtable cleanTables = ( new
Hashtable("PropertiesCleaned", "PropertyID"),
new
Hashtable("SubjectPropertiesCleaned","SubjectPropertyID"),
new
Hashtable("RoomCountsCleaned" ,"RoomCountID"));


Thanks,

Tom
 
A

Alberto Poblacion

tshad said:
In VS 2005, is there a way to create and initialize a hashtable in one
statement?

Something like (I know this isn't correct):

public static Hashtable cleanTables = ( new
Hashtable("PropertiesCleaned", "PropertyID"),
new
Hashtable("SubjectPropertiesCleaned","SubjectPropertyID"),
new
Hashtable("RoomCountsCleaned" ,"RoomCountID"));


No, this is a new feature en C# 3.0 (VS 2008). In 2005 you need to use
several statements to first create the hashtable and then add the items.
 
T

tshad

Alberto Poblacion said:
No, this is a new feature en C# 3.0 (VS 2008). In 2005 you need to use
several statements to first create the hashtable and then add the items.

That was what I thought.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top