blasto_max
SSCertifiable
Points: 5025
More actions
October 21, 2013 at 5:32 pm
#284065
I have a result set like (in SSIS actually) -
ID, Name, Address
1,John, Japan
2,Sarah, UK
3,Jeremy, USA
I want to be able to select any column out of the above in the result set/record set and then iterate over that column's rows. How do I do that ?
Koen Verbeeck
SSC Guru
Points: 259155
October 22, 2013 at 2:19 am
#1660408
string columnname = "Name";
DataTable myTable; -- don't forget to initialize datatable
foreach(Datarow row in myTable.Rows){
Console.WriteLine(row[columnname]);
}
Haven't tested it, but it shouldn't be far off.
Need an answer? No, you need a questionMy blog at https://sqlkover.com.MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy