Hi,
in .net you get only datatables and datasets, a datatable is made out of datarows, those are very very similar to hashtables and in most cases you can use those to achieve the tasks, but if you need hashtable you can use this code
public static Hashtable convertDataRowToHashTable(DataRow dr)
{
if (dr == null)
{
return null;
}
Hashtable ret = new Hashtable(dr.Table.Columns.Count);
for (int iColNr = 0; iColNr < dr.Table.Columns.Count; iColNr++)
{
ret[dr.Table.Columns[iColNr].ColumnName] = dr[iColNr];
}
return ret;
}
other direction (hast table to datrow) is not that easy, as datarow does not have a public constructor (by design) and you have to call newRow = myDataTable.NewRow(); to get a new instance of a row, and than you can work with row almost as with hashtable
newRow["column1"]="some value";
but if you need a new column in hashtable you will have to add column to datatable and not to data row myTable.Columns.Add("name", "type");
hope this helps