3 Replies - 7138 Views - Last Post: 14 January 2010 - 09:06 PM Rate Topic: -----

#1 athisayan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 14-January 10

Urgent! DataColumn to string Array

Post icon  Posted 14 January 2010 - 04:39 AM

DataSet dsRegistrationData = new DataSet();
            dsRegistrationData = clas.LoadRegistrationDetails();

            
            DdlConCountry.DataSource = dsRegistrationData.Tables["Country"];



dsRegistrationData.Tables["Country"] this table contains A column named COUNTRY_NAME ..
How can i store this column values into an string array without using loop like for while foreach etc..


Array.ConvertAll<DataRow, String>(dsRegistrationData.Tables["State"].Select(), delegate(DataRow row) { return (String)row["State_NAME"]; }) this is a way but the delegate section looping here, is their any other way? :D

Is This A Good Question/Topic? 0
  • +

Replies To: Urgent! DataColumn to string Array

#2 papuccino1  Icon User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 63
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: Urgent! DataColumn to string Array

Posted 14 January 2010 - 04:44 AM

Just to be clear, you want a way to copy the value of X column into a String[] array without using an iteration loop, correct?
Was This Post Helpful? -1
  • +
  • -

#3 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: Urgent! DataColumn to string Array

Posted 14 January 2010 - 07:19 AM

athisayan: I believe your solution and iterating through all the rows is the only way to do it...
Was This Post Helpful? 1
  • +
  • -

#4 athisayan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 14-January 10

Re: Urgent! DataColumn to string Array

Posted 14 January 2010 - 09:06 PM

View Postpapuccino1, on 14 Jan, 2010 - 03:44 AM, said:

Just to be clear, you want a way to copy the value of X column into a String[] array without using an iteration loop, correct?

yes

View PostFlashM, on 14 Jan, 2010 - 06:19 AM, said:

athisayan: I believe your solution and iterating through all the rows is the only way to do it...

Thank you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1