Writing Dataset.table to excel in specific format

This is the dataset.table(0)

I want to write it in this format in Excel

image

Thanks!

Hi @Sami_Rajput

Try using dataset.table(1)

looks like you want to transform a DataTable with 1 row into a Key, Value Structure

Build DataTable Activity: - dtKVData

  • Col1: - Name: Key , DataType: String
  • Col2: - Name: Value, DataType: Object

Assign Activity
dtKVData =

(From d in dataset.table(0).AsEnumerable
From c in dataset.table(0).Columns.Cast(Of DataColumn)
let ra = new Object(){c.ColumnName, d(c.ColumnName)}
Select r = dtKVData.Rows.Add(ra)).CopyToDataTable
1 Like

@ppr

getting this error

sorry had a typo. just refer to the fixed LINQ

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.