I want to add first two columns of excel file into hashtable.. I wrote following code but it is giving me eror saying indexing not allowed in datacolumn...
Hashtable ExcelSheets = new Hashtable();
System.Data.DataColumn dc;
// adding excel file into hash table
if (dt1.Columns.Count > 0)
{
for (int c = 0; c < dt1.Columns.Count; c++)
{
try
{
ExcelSheets.Add(dc[0].ToString().ToLower(), dc[1].ToString().ToLower());
}
catch (Exception)
{
}
}
}
What 2 do?