FuncionarioModel item;
DAL objDAL = new DAL();
string sql = $"SELECT Id, Nome FROM funcionario where id ='{id}' ORDER BY Nome asc";
DataTable dt = objDAL.RetDataTable(sql);
item = new FuncionarioModel
{
Id = dt.Rows[0]["Id"].ToString(),
Nome = dt.Rows[0]["Nome"].ToString()
}
return item;
I tried something similar: (i know it's wrong. but I thought of something like that.)
just a way that I thought
AgendaModel item;
DAL objDAL = new DAL();
string sql = $"SELECT Id, title, start, end, allday, color, textcolo FROM Agenda;
events dt = objDAL.RetDataTable(sql);
item = new AgendaModel
{
Id = dt.Rows[0]["Id"].ToString(),
Nome = dt.Rows[0]["Nome"].ToString()
}
return item;
There are many fully functional FullCalendar MVC examples on the internet. I recommend you start with a few examples to see how others have implemented the same. Below are a few but you can Google for more examples.
The main issue I see with your approach is you are using a DataTable. The DataTable is ASP.NET construct used to bind data to data bound server controls. The FullCalendar is a JavaScript/jQuery API that runs in the browser The data format is JSON. It
is up to you to learn the FullCalendar API so you know what data to pass back and forth.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
3 Points
13 Posts
FullCalendar with Mysql
Jun 03, 2020 09:58 AM|klasss|LINK
Hi,
This is my first experience with ASP.NET .
I've done several small projects and now I want to do something a little bigger.
I try use FullCalendar with connect mysql.
I have in View -- index :
Model -- AgedaModel
And Controller -- AgendaController
I need a little guidance for this little project of mine. I thank anyone who can explain to me
Contributor
5961 Points
2466 Posts
Re: FullCalendar with Mysql
Jun 03, 2020 02:00 PM|KathyW|LINK
"I need a little guidance for this little project of mine. I thank anyone who can explain to me"
What guidance do you need? What is not working as expected in the code you are trying? What errors do you get?
Member
3 Points
13 Posts
Re: FullCalendar with Mysql
Jun 03, 2020 04:03 PM|klasss|LINK
To show data in a table I used the following:
This to show in a table:
I tried something similar: (i know it's wrong. but I thought of something like that.)
just a way that I thought
Contributor
5961 Points
2466 Posts
Re: FullCalendar with Mysql
Jun 03, 2020 04:54 PM|KathyW|LINK
Start at the beginning. What are you trying to do? What is the full code you are trying? What does it do that you don't expect it to do?
All-Star
53011 Points
23596 Posts
Re: FullCalendar with Mysql
Jun 03, 2020 04:58 PM|mgebhard|LINK
There are many fully functional FullCalendar MVC examples on the internet. I recommend you start with a few examples to see how others have implemented the same. Below are a few but you can Google for more examples.
https://www.toshalinfotech.com/Blogs/ID/115/How-to-Integrate-Full-calendar-with-MVC-application
https://www.c-sharpcorner.com/article/asp-net-mvc5-full-calendar-jquery-plugin/
The main issue I see with your approach is you are using a DataTable. The DataTable is ASP.NET construct used to bind data to data bound server controls. The FullCalendar is a JavaScript/jQuery API that runs in the browser The data format is JSON. It is up to you to learn the FullCalendar API so you know what data to pass back and forth.
Contributor
2690 Points
774 Posts
Re: FullCalendar with Mysql
Jun 04, 2020 05:54 AM|YihuiSun|LINK
Hi, klasss
You can refer to the example in this link. You only need to use your own way to connect to the database.
http://www.dotnetawesome.com/2017/07/curd-operation-on-fullcalendar-in-aspnet-mvc.html
Best Regards,
YihuiSun