Maniupulating information from a dataset to save it into an array ???? [modified]
-
Hello to everybody, i hope you can help me, I have a dataset which contains datas from a table..this table has 2 fields (id and data) both are string, well i want to do this: i need to get all the datas from every id and save them into an array, i need this for every id... Note: the id may be repeated according to the number of datas that contains that id.....for example: ........................................................................... This is what my dataset contains
ID DATA
04231050 368 ...here you can see that the id is repeated
04231050 234 ...
04333333 445 ......other id repeated
04333333 557 ......
04235789 786........................................................................... But I want it like this:
ID DATA DATA
04231050 368 234
04333333 445 557
04235789 786modified on Monday, April 6, 2009 2:10 PM
-
Hello to everybody, i hope you can help me, I have a dataset which contains datas from a table..this table has 2 fields (id and data) both are string, well i want to do this: i need to get all the datas from every id and save them into an array, i need this for every id... Note: the id may be repeated according to the number of datas that contains that id.....for example: ........................................................................... This is what my dataset contains
ID DATA
04231050 368 ...here you can see that the id is repeated
04231050 234 ...
04333333 445 ......other id repeated
04333333 557 ......
04235789 786........................................................................... But I want it like this:
ID DATA DATA
04231050 368 234
04333333 445 557
04235789 786modified on Monday, April 6, 2009 2:10 PM
Not really related to Asp.Net. I recommend you to repost your question in the appropriate forum to enhance the chance to get a proper answer. But until then you can read up on Jagged Arrays here[^] or here[^] depending on your lingual taste.
"Lots of programmers have had sex - some have even had it with members of the same species." - Pete O'Hanlon
-
Hello to everybody, i hope you can help me, I have a dataset which contains datas from a table..this table has 2 fields (id and data) both are string, well i want to do this: i need to get all the datas from every id and save them into an array, i need this for every id... Note: the id may be repeated according to the number of datas that contains that id.....for example: ........................................................................... This is what my dataset contains
ID DATA
04231050 368 ...here you can see that the id is repeated
04231050 234 ...
04333333 445 ......other id repeated
04333333 557 ......
04235789 786........................................................................... But I want it like this:
ID DATA DATA
04231050 368 234
04333333 445 557
04235789 786modified on Monday, April 6, 2009 2:10 PM
put your dataset Table in to dataview and then convert it back to table with distinct values and then covert datatable to array as follow C# [code] DataView dv=new DataView(ds.Tables["tblName"]); DataTable temp=dv.ToTable(true,"col1","col2"); [/code] now convert temp to array