using System.Collections.Generic;
public static void Main()
DataTable dt_MappedColumns = new DataTable();
dt_MappedColumns.Columns.Add("Sr.No");
dt_MappedColumns.Columns.Add("TColumnName");
dt_MappedColumns.Columns.Add("AColumnName");
dt_MappedColumns.Rows.Add("1", "Apple", "Lion");
dt_MappedColumns.Rows.Add("2", "Orange", "Tiger");
dt_MappedColumns.Rows.Add("3", "Mango", "Fox");
dt_MappedColumns.Rows.Add("4", "Orange", "Wolf");
var dictionary1 = new Dictionary<string, object>();
foreach (DataRow dr in dt_MappedColumns.Rows)
string key = dr["TColumnName"].ToString();
string value = dr["AColumnName"].ToString();
if (!dictionary1.ContainsKey(key))
dictionary1.Add(key, value);
object existingValue = dictionary1[key];
if (existingValue is string)
dictionary1[key] = new List<string> { (string)existingValue, value };
((List<string>)existingValue).Add(value);
string Manjson = JsonConvert.SerializeObject(dictionary1);
Console.WriteLine(Manjson);