I have this query to insert the data into a chart. The problem is that when the graph appears ... the date appears numerical and I would like it to appear before with the name of the month referring to that date and if possible the year also.
[HttpPost]
public JsonResult AjaxMethod()
{
string query = "SELECT DataEntrada, COUNT(ID_Reserva) TotalReservas From Reserva Group by DataEntrada";
var constr = ConfigurationManager.ConnectionStrings["Hotel"].ConnectionString;
List < object > chartData = new List<object>();
chartData.Add(new object[]
{
"DataEntrada", "TotalReservas"
});
using(SqlConnection con = new SqlConnection(constr))
{
using(SqlCommand cmd = new SqlCommand(query))
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
using(SqlDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read()) {
chartData.Add(new object[]
{
sdr["DataEntrada"], sdr["TotalReservas"]
});
}
}
con.Close();
}
}
return Json(chartData);
}
Final result