-1
Datatable data can be stored in JSON?
I have this code:
public List<AgendaModel> MostrarTodosCalendar()
{
List<AgendaModel> lista = new List<AgendaModel>();
AgendaModel item;
DAL objDAL = new DAL();
string sql = "SELECT id, title, start, end, AllDay, Color, TextColor FROM agenda";
DataTable dt = objDAL.RetDataTable(sql);
for (int i = 0; i < dt.Rows.Count; i++)
{
item = new AgendaModel
{
Id = dt.Rows[i]["Id"].ToString(),
Title = dt.Rows[i]["Title"].ToString(),
Start = dt.Rows[i]["Start"].ToString(),
End = dt.Rows[i]["End"].ToString(),
//AllDay = dt.Rows[i]["Allday"].ToString(),
Color = dt.Rows[i]["Color"].ToString(),
TextColor = dt.Rows[i]["TextColor"].ToString()
};
lista.Add(item);
}
return lista;
}