Click here to Skip to main content
15,861,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: Looking to Learn Programming better Need help please. Pin
PIEBALDconsult16-Dec-09 10:35
mvePIEBALDconsult16-Dec-09 10:35 
GeneralRe: Looking to Learn Programming better Need help please. Pin
Luc Pattyn16-Dec-09 11:02
sitebuilderLuc Pattyn16-Dec-09 11:02 
GeneralRe: Looking to Learn Programming better Need help please. Pin
PIEBALDconsult16-Dec-09 11:50
mvePIEBALDconsult16-Dec-09 11:50 
AnswerRe: Looking to Learn Programming better Need help please. Pin
BillWoodruff16-Dec-09 18:17
professionalBillWoodruff16-Dec-09 18:17 
QuestionContinued Values Collection/List/Dictionary [modified] Pin
Som Shekhar16-Dec-09 7:48
Som Shekhar16-Dec-09 7:48 
AnswerRe: Continued Values Collection/List/Dictionary Pin
#realJSOP16-Dec-09 9:04
mve#realJSOP16-Dec-09 9:04 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 19:16
Som Shekhar16-Dec-09 19:16 
AnswerRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen16-Dec-09 10:19
professionalEddy Vluggen16-Dec-09 10:19 
Value1, value2 and value3 are distinct entities that you want to track? A dictionary consists of a value and a key. The key would be your index-column, the value could be a struct that holds the three columns;
System.Collections.Generic.Dictionary<int, MyValues> myListOfValues;

struct MyValues
{
   int value1;
   int value2;
   int value3;
}
You could consider the generic list as your datatable, and the struct as a single row in that table. Now you can add values to your dictionary;
MyValues oneRow = new MyValues();
oneRow.value1 = 100;
oneRow.value2 = 200;
oneRow.value3 = 300;
myListOfValues.Add(1, oneRow);
Now, if you want the recreate those values for index 3, you would have to search in the list for the first non-empty value for the column value2.

If speed is important, then I'd create one row outside of that list, just to mirror the current values. That wouldn't help if you need the values from the middle of the index, you'd still have to walk the list for that.

How many records will be in that list? It might just be worth to store copies of the latest value, instead of looking for them.

I are Troll Suspicious | :suss:

GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 19:15
Som Shekhar16-Dec-09 19:15 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen16-Dec-09 21:13
professionalEddy Vluggen16-Dec-09 21:13 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 21:28
Som Shekhar16-Dec-09 21:28 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen16-Dec-09 21:34
professionalEddy Vluggen16-Dec-09 21:34 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 21:39
Som Shekhar16-Dec-09 21:39 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen16-Dec-09 21:53
professionalEddy Vluggen16-Dec-09 21:53 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 21:56
Som Shekhar16-Dec-09 21:56 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen17-Dec-09 1:53
professionalEddy Vluggen17-Dec-09 1:53 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar17-Dec-09 2:40
Som Shekhar17-Dec-09 2:40 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen17-Dec-09 9:34
professionalEddy Vluggen17-Dec-09 9:34 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar17-Dec-09 10:12
Som Shekhar17-Dec-09 10:12 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen17-Dec-09 13:13
professionalEddy Vluggen17-Dec-09 13:13 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar18-Dec-09 18:59
Som Shekhar18-Dec-09 18:59 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen19-Dec-09 0:48
professionalEddy Vluggen19-Dec-09 0:48 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar19-Dec-09 2:28
Som Shekhar19-Dec-09 2:28 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen19-Dec-09 9:41
professionalEddy Vluggen19-Dec-09 9:41 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar19-Dec-09 20:16
Som Shekhar19-Dec-09 20:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.