I currently have an arraylist in C# which holds the my data base table (having 4 columns with 2 being dateTime objects in C#),I want to read the values of the arrayList into javascript object ,here is class constructor of the object class to were I want to store the arraylist data:
function job()
{
this.name="new_job";
this.Sdate=17;
this.Edate=25;
this.Smonth=1;
this.Emonth=1;
this.color='B'
this.Syear=2012;
this.Eyear=2012;
}
I want to achieved something like this in javascript:
jobObject1.name=arrayList's first row first object,
I don’t have any idea of how data is actually stored in an array list,infact I am using it for the first time,if there is any other way storing the data from my data table to javascript objects besides using arrayList please tell me ,I would use that..
I just want to somehow pass the data table to my javascript object using array list or not
You can convert your datatable to a JSON object.There are some custom libs for it like JSON.net or you can write your own function.Refer to the following link for custom converstion:-
http://www.codeproject.com/Articles/19396/Convert-ASP-NET-DataTable-to-JSON-to-use-a-DataTab