DataTable to List
var r = Shared.Process(this.ws, "TraBULLETINGet", form);
List<Bulletin> bulletin = new List<Bulletin>();
foreach (DataRow dr in r.ds.Tables["T1"].Rows)
{
bulletin.Add(new Bulletin { TITLE = dr["TITLE"].ToString(), DES = dr["DES"].ToString(), CREATE_DATE = dr["CREATE_DATE"].ToString() });
}
var jsonSerialiser = new JavaScriptSerializer();
var json = jsonSerialiser.Serialize(bulletin);
public class Bulletin
{
public string TITLE { get; set; }
public string DES { get; set; }
public string CREATE_DATE { get; set; }
}
沒有留言:
張貼留言