473,386 Members | 1,610 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,386 software developers and data experts.

Can't create and initialize list (or hashtable) in one statement...?!

System.Collections.Hashtable h = new System.Collections.Hashtable() {
null };

Complains about ";" being expected after '()'.

Using Visual Studio 2005. What's going on?
Feb 12 '08 #1
1 1474
Big Bird wrote:
System.Collections.Hashtable h = new System.Collections.Hashtable() {
null };

Complains about ";" being expected after '()'.

Using Visual Studio 2005. What's going on?
for a list, you can do this:

List<Tlist = new List<T>(new T[] { elem1, elem2, elem3, elem4 });
Feb 13 '08 #2

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

Similar topics

1
by: Chris Asaipillai | last post by:
Ok i have a Visual Basic Group of projects contaiining the following Talk Talk.vbp (Visual Basic Project) and the main application 3 DLLS inc Import Files Login Audit Render
3
by: Tony Johansson | last post by:
Hello!! Hello Experts! I'm right if I say that if I have attribute that is constant or attribute that is of reference type or attribute that is class type then I must use initialize list. ...
2
by: sonu | last post by:
I am tring to create activexobject like var Fo =new ActiveXObject("Scripting.FileSystemObject"); but i am finding error that automation server cant create object any help
7
by: Dave Elliott | last post by:
I have a db that is split and shared on the network. I gave the user a custom menu to use. We both use the same tables of course. On my PC I can create new records using their menu on my PC, on...
3
by: Steve Richter | last post by:
running a simple vbscript in an .htm page that starts excel and loads the spreadsheet with the contents of a <table> ... </table> getting an "Error: ActiveX component cant create object....
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
9
by: yinglcs | last post by:
Hi, How can I create a list of list in STL? I try list < list <A*> >, but that does not work, I get compiler errors.
3
by: Propoflady | last post by:
Hi I have a table that has these two fields, company, lastname. I want to create a query that when I type in the characters will return all the values in the company and last name field that...
1
by: erotikaboi | last post by:
Guys, Firstly let me say I am a photographer so if you can offer me a solution I will really appreciate it in simple english not techiespeak as I wont understand it. Thanks. Ok, I am using Access...
2
by: Mark S. | last post by:
Hello, I have a static class with several hundred private static List<>. Does the ..NET framework keep an internal List/Hashtable/Collection of all my Lists that I can loop over? If so, please...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.