Click here to Skip to main content
15,913,101 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
hi all

i have a Datatable named DT1

this Datatable Have :
Maximum Row = 5
Colum =1 (Only 1 Column)

MyArray Is A String Array : string MyArray= new String[5]

i Want To Do Copy This 5 Cell To MyArray

Example

DataTable Items :
5
4
3
2
1

MyArray Items Must Like Below:
5  4  3  2  1


How Do I this ?

Please Help Me
Posted

Hello

Follow the following, step by step:

1. Arrays (C# Programming Guide)
2. Using Iterators (C# Programming Guide)
3. Using ADO.Net
4. Now, Define Array[5], Iterate reading the entity, then set the values of the arrays with entity values.
 
Share this answer
 
v3
Iterate through the rows in the DataTable and place each value into a List or array. What part are you having difficulty with?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900