sony Posted October 14, 2005 Posted October 14, 2005 can someone tell me how i can loop through a datatables first column values and put it in an array.. thanks in advance Quote
rfazendeiro Posted October 14, 2005 Posted October 14, 2005 You can loop throught a data dateble very easaly [csharp] ArrayList arrL = new ArrayList(); foraech(DataRow drTemp in dt.Rows) { arrL.Add(drTemp["PUT NAME OF 1º COlUMN HERE"]) } [/csharp] dont forget you have to cast da datarow to the type of value it has. [csharp] (string)drTemp["PUT NAME OF 1º COlUMN HERE"] (int)drTemp["PUT NAME OF 1º COlUMN HERE"] (byte)drTemp["PUT NAME OF 1º COlUMN HERE"] [/csharp] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.