monica
monica

Reputation: 91

Load my array into a Dictionary

I have a DataTable. I want to load my DataTable into an Array. Now I want to append my array into my Dictionary using C#. Suggest me some ideas...

DataTable dt = new DataTable();//I have some column value in my table
 Dictionary<string, object> lst = new Dictionary<string, object>();
var  tableEnumerable = dt.AsEnumerable();
 var  tableArray = tableEnumerable.ToArray();

Upvotes: 0

Views: 86

Answers (1)

Alrehamy
Alrehamy

Reputation: 316

here is the solution, I think you must search the SO knowledgebase before posting already exist questions.

How to Convert the value in DataTable into a string array in c#

Upvotes: 2

Related Questions