I am trying to send c# DataTable data to Jquery DataTable but i don't know how it can be possible. Here is my Code but its not working.
public JsonResult GetJsonBiltyList()
{
SqlDataAdapter sda = new SqlDataAdapter("SELECT o.*, (SELECT COUNT(*) FROM OrderVehicle_Clone WHERE OrderID = o.ID) AS Vehicles, (SELECT COUNT(*) FROM OrderConsignment_Clone WHERE OrderID = o.ID) AS Containers, (SELECT COUNT(*) FROM OrderProduct_Clone WHERE OrderID = o.ID) AS Products, (SELECT COUNT(*) FROM OrderDamage_Clone WHERE OrderID = o.ID) AS Damage, (SELECT COUNT(*) FROM OrderReimursable_Clone WHERE OrderID = o.ID) AS Reimursables, (SELECT COUNT(*) FROM OrderRecieveBy_Clone WHERE OrderID = o.ID) AS OrderRecieveBy_Clone FROM Order_Clone o", con);
DataTable dt = new DataTable();
sda.Fill(dt);
// List<DataRow> SearchBiltyList = dt.AsEnumerable().ToList();
//SearchBiltyDTO bilty = new SearchBiltyDTO();
//bilty.PickUpLocation = dt.Rows[0]["PickUpLocation"].ToString();
//bilty.DropLocation = dt.Rows[0]["DropLocation"].ToString();
//bilty.Vehicles = Convert.ToInt64(dt.Rows[0]["Vehicles"]);
//bilty.Containers = Convert.ToInt64(dt.Rows[0]["Containers"]);
//bilty.Products = Convert.ToInt64(dt.Rows[0]["Products"]);
//bilty.Damage = Convert.ToInt64(dt.Rows[0]["Damage"]);
//bilty.Reimursables = Convert.ToInt64(dt.Rows[0]["Reimursables"]);
return Json(new { data = dt.AsEnumerable().ToList() }, JsonRequestBehavior.AllowGet);
}