Last post Jul 08, 2015 02:09 AM by Fei Han - MSFT
Jul 07, 2015 12:45 PM|becky123455|LINK
Hi i am trying to do a event calendar where i can perform crud on it.
i currently following this http://codedisplay.com/building-database-driven-event-calendar-using-asp-net-c-vb-net/)
however the data is hardcoded into the calendar. any idea which i could retrieve data from mysql and be viewed on the calendar?
Jul 08, 2015 02:09 AM|Fei Han - MSFT|LINK
Welcome to ASP.NET forum.
any idea which i could retrieve data from mysql and be viewed on the calendar?
You could use MySQLConnector to connect to and access MySQL database like this.
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (MySqlConnection con = new MySqlConnection(constr))
using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM YourTable"))
using (MySqlDataAdapter sda = new MySqlDataAdapter())
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
//bind your DatatList with "dt"
For more information, please refer to this article.