using System.Collections.Generic;
public static void Main()
DataTable dt = new DataTable();
dt.Columns.Add("Key", typeof(string));
dt.Columns.Add("Value", typeof(string));
var rowOne = dt.NewRow();
rowOne["Key"] = "userName";
rowOne["Value"] = "userNameValue";
var rowTwo = dt.NewRow();
rowTwo["Key"] = "password";
rowTwo["Value"] = "passwordValue";
var rowThree = dt.NewRow();
rowThree["Key"] = "domain";
rowThree["Value"] = "domainValue";
Dictionary<string, string> dict = new Dictionary<string, string>();
foreach(DataRow row in dt.Rows)
dict.Add(row["Key"].ToString(), row["Value"].ToString());
foreach (var kvp in dict)
Console.WriteLine($"Key: {kvp.Key}, Value: {kvp.Value}");