How to convert dictionary into data table with out for loop

Hi

i need to convert the dictionary into datatable with out using the for loop ids there any way to acive this.

@kalyanDev

Let us take you are having Dictionary ABC of key type string and value type also string.
Build One DataTable with Appropriate Column Names for Key and Value. as Dta

Let us take the first column as Key and Second Column as Value

Dta=(From p In ABC
Select Dta.Rows.Add(p.Key.ToString,p.Value.ToString)).ToArray.CopyToDataTable

Now Dta is the DataTable which contains Dictionary Values.

Regards,
Mahesh

1 Like

Thanks.

@kalyanDev

Mark it as solution if it resolved your requirement. So that others can use this thread.

Regards,
Mahesh