Linq is the answer. You can convert a DataTable to IEnumerable using the AsEnumerable method. Then, the ToArray() converts it to an array.
var tableEnumerable = DataTableName.AsEnumerable();
tableArray = tableEnumerable.ToArray();
protected string GetTabValue()
{
JavaScriptSerializer jSerializer=new JavaScriptSerializer();
return jSerializer.Serialize(tableArray );
}
//3.2 Acces this function in your js and do what you want to do . this should be in you .aspx page.
var x = '<%=GetTabValue()%>';
alert(x);