[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is there any possibilty to use an undefined (unlimited) amount
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 6
Thread images: 1
File: 1442809571046.png (2 MB, 1920x1080) Image search: [Google]
1442809571046.png
2 MB, 1920x1080
Is there any possibilty to use an undefined (unlimited) amount of objects for any data type in C#?

Example: you have "Dictionary<int, Tuple<string, string>>". I want the tuple to be able to be able to hold an unlimited (dynamically adjusted) amount of objects. Is this possible with any type in C#?
>>
How much memory does an infinite list occupy?

Theres your answer.
>>
>>55242750
Obviously it is not about an infinite list but rather of having the possibilty to choose between 1 or for example 10 values. To be concrete: I am having an sql database and I do not know how many columns are asked for which means I have to either use an array of which most of the time 9 entries are completely empty, which is not only a really ugly way but also terribly annoying as it fucks up with multiple loops or I have to override it which bloats the code uslessly.

I mean you already have the params argument in C# so why not the other way around?
>>
>>55242750
Well as I get no answer I will have to use an ugly way: I will add a delimiter and split the result. It is terribly ugly but appearently I have no other choice
>>
>>55242797
Why don't you just use a SqlDataReader or some other object designed for reading result sets from a database and just get its number of columns using FieldCount? You can then store the results in a DataTable. This scenario is better handled with a solution designed specifically for database usage.
>>
You want a list of a size that will determined at run-time? Try a list.
Thread replies: 6
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.