You can use the following function to convert a DataTable to a HashTable,
public static Hashtable convertDataTableToHashTable(DataTable dtIn,string keyField,string valueField) { Hashtable htOut = new Hashtable(); foreach(DataRow drIn in dtIn.Rows) { htOut.Add(drIn[keyField].ToString(),drIn[valueField].ToString()); } return htOut; }
Then in your code just use
Hashtable sendData = new Hashtable(); //You need to pass datatable, key field and value field sendData = convertDataTableToHashTable(dt, "orderNumber", "customerName");
Abhilash Ravindran CK
source share