Part 3 | How to Create a Calendar | Display Events | C# | Windows Form

Sdílet
Vložit
  • čas přidán 24. 10. 2021
  • Thanks for watching. If you liked this video, make sure to subscribe for more
    PART 1
    • PART 1 | How To Create...
    PART 2
    • Part 2 | How to Create...
  • Věda a technologie

Komentáře • 61

  • @cj-nu6ht
    @cj-nu6ht Před 2 lety

    I just had to thank you for the videos. They helped out a lot keep up the good tutorials.

  • @hansgonzalez8686
    @hansgonzalez8686 Před rokem +1

    Hi Joe! Thank you for this video !!

  • @isaiasfranciscodasilva644

    Great video, it helped me a lot.
    Thanks.

  • @rasbry225
    @rasbry225 Před 2 měsíci

    Nice master, cant wait to save multiple days like " booking days " waiting for update master.

  • @LetsTimZR
    @LetsTimZR Před 2 lety +4

    How can i add more than one event to a specific date? For Instance your video "Calendar Event Scheuduler". Do you have the code anywhere published ?

  •  Před rokem

    good job

  • @eng.hasaneldor6001
    @eng.hasaneldor6001 Před rokem

    wonderful,i have a question can i display all events while I load the calendar or months

  • @storeload
    @storeload Před 4 měsíci

    Really great video series thank you. Is there no other way of auto updating the calendar view rather than polling the database? it seems like a waste of resources. In this case it isn't too bad, but I have built similar apps using a client to view the data and update. The only way I could do this was using regular polling to update. I did get it working with Service Broker using MSSQL the once, but this proved to be very complicated and not really worth the hassle.

  • @raouffofe
    @raouffofe Před 2 lety +1

    شكرا جزيلا صديقي عمل رائع

  • @CarlosRomero-qy3du
    @CarlosRomero-qy3du Před rokem

    @coding_ideas I need help the event wont show on the calendar after pressing the button. I even checked the timer

  • @SENSEIKRT
    @SENSEIKRT Před 2 lety

    can you do a calendar that display events without using SQL server? Thanks

  • @playtoy_cardi_7201
    @playtoy_cardi_7201 Před 2 lety

    Is it possible that you made a video with a data base?
    In the data base, you'll have the month day etc, that when inserted either in the data base or the actual winform, the events would show up

    • @coding_ideas
      @coding_ideas  Před 2 lety +1

      hello, thanks for the suggestion. when i made this video I assume that viewers already know how to make a database :) . i will include database creation next time :) . thank you

  • @ebrahimabd-elrazik24
    @ebrahimabd-elrazik24 Před rokem

    I just wanted to know how to make a mark on today so the user know that we are in November 1st something like that

  • @user-wr4ez7iv7q
    @user-wr4ez7iv7q Před 2 lety

    Hi! When I run the program I have a large number of EventForms open

  • @nicolahoward8712
    @nicolahoward8712 Před 2 lety

    Hi Jeov. I have a problem with the syntax of the select statement. I get an error that says incorrect syntax near the "?". I even put the query through the query builder but cannot find the problem. I hope you can shed some light on it for me.
    Regards from the UK

    • @coding_ideas
      @coding_ideas  Před 2 lety

      Hi Nicola, It seems like there is sth wrong with ur query statemnt. Check your query statement if its correct. Double check if the syntax is correct or if there are no mispelled words .

  • @arsenic8123
    @arsenic8123 Před 2 lety +3

    Hello, nice tutorial and thank you for the video. I have an issue about displaying the text in event calendar. I didn't got an error but the text does not appear after I add an event . I use SqlServer (System.Data.SqlClient) and I used @Date instead "?" in SQL query. Can you help me with this problem? Thank you in advance.

    • @abdelrhmanahmed5131
      @abdelrhmanahmed5131 Před 2 lety

      same here did u find a solution ?

    • @felixandro1512
      @felixandro1512 Před 2 lety

      same. Any tips?

    • @arsenic8123
      @arsenic8123 Před 2 lety

      @@abdelrhmanahmed5131 Hello, I found this solution:
      private void displayEvent()
      {
      SqlConnection con = new SqlConnection(connectionString);
      con.Open();
      string sql = "SELECT * FROM Event WHERE date= @date";
      SqlCommand cmd = con.CreateCommand();
      cmd.CommandText = sql;
      cmd.Parameters.AddWithValue("date", FormAdmin.static_year + "-" + FormAdmin.static_month + "-" + lblDays.Text + lbltime.Text);
      SqlDataReader reader = cmd.ExecuteReader();
      if (reader.Read())
      {
      lbevent.Text = reader["Event"].ToString();
      lbltime.Text = reader["Time"].ToString();
      }
      reader.Dispose();
      cmd.Dispose();
      con.Close();
      }
      This worked for me.

    • @matias-5050
      @matias-5050 Před 2 lety

      solution?

    • @javierchinchilla9981
      @javierchinchilla9981 Před rokem

      Did you guys find a solution?

  • @shainamae2857
    @shainamae2857 Před 2 lety

    THANK YOU PO

  • @narbae2522
    @narbae2522 Před 8 měsíci +1

    Why is the event are duplicating after i click to another usercontrol

  • @nicolahoward8712
    @nicolahoward8712 Před 2 lety +3

    Because I am using SQL Server I had to change the '?' to @Date. Worked fine after that : )

    • @TheGame1083
      @TheGame1083 Před 2 lety +1

      Yes same here, I had to utilize @Date and @ Event as I also used SQL Server

    • @JeremyTelmoro
      @JeremyTelmoro Před 8 měsíci

      how to change this code into sql server?@@TheGame1083

    • @JeremyTelmoro
      @JeremyTelmoro Před 8 měsíci

      this is my code guys using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.Data;
      using System.Data.SqlClient;
      using System.Drawing;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      namespace HealthCare_Dashboard
      {
      public partial class UserControlDays : UserControl
      {
      public static string static_day;
      public UserControlDays()
      {
      InitializeComponent();
      }
      SqlConnection Con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Armando\OneDrive\Documents\event.mdf;Integrated Security=True;Connect Timeout=30");
      private void UserControlDays_Load(object sender, EventArgs e)
      {
      }
      public void days(int numday)
      {
      ibdays.Text = numday.ToString();
      }
      private void UserControlDays_Click(object sender, EventArgs e)
      {
      static_day = ibdays.Text;
      timer1.Start();
      Form5 eventform = new Form5();
      eventform.Show();
      }
      // create a new method to display event
      private void displayEvent()
      {
      {
      Con.Open();
      string sql = "SELECT * FROM [Table] WHERE Date = @date";
      using (SqlCommand cmd = new SqlCommand(sql, Con))
      {
      cmd.Parameters.AddWithValue("@date", Form4.static_year + "_" + Form4.static_month + "_" + ibdays.Text);
      using (SqlDataReader reader = cmd.ExecuteReader())
      {
      if (reader.Read())
      {
      lbevent.Text = reader["Event"].ToString();
      }
      }
      }
      Con.Close();
      }
      }
      //create a timer for auto display event if new event is added
      private void timer1_Tick(object sender, EventArgs e)
      {
      //call the displayEvent method
      displayEvent();
      }
      }
      }

    • @mahmoudhmila4915
      @mahmoudhmila4915 Před 3 měsíci

      Hello .. did it work when you add event did he show in the calander or no please ?

  • @lsmendola9323
    @lsmendola9323 Před rokem

    hello , my timer is doent s uptade after i add event and he s dont show in calenday, any sugestion?

  • @misbxh
    @misbxh Před 7 měsíci

    how do i do this if i dont have sql please help asap

  • @fiza758
    @fiza758 Před 2 lety

    When i type in a new event on a different date, the previous usercontrolday boxes i clicked on, populate with the exact same event that i just entered, do you know how to fix this?

    • @felixandro1512
      @felixandro1512 Před 2 lety

      i have the same problem. Do you know how to fix it?

  • @ALANANTONIOJIMENEZSALAZAR
    @ALANANTONIOJIMENEZSALAZAR Před 4 měsíci

    is this possible without the database?

  • @JeremyTelmoro
    @JeremyTelmoro Před 8 měsíci

    How to convert it into a sql command?

  • @quochung27092k
    @quochung27092k Před rokem

    Can you share the source code?

  • @Richmond1226
    @Richmond1226 Před 2 lety

    lods hindi lumalabas ung nilagay ko sa event sa calendar

  • @zulkarneyneryilmaz1600
    @zulkarneyneryilmaz1600 Před 8 měsíci

    Hello, I am having a problem with SQL Server. It does not accept question marks.

  • @niyazigokmen5612
    @niyazigokmen5612 Před rokem

    bro for me it works it displays it but it displays all the events in my data how do i fix it so that it only shows the events on that day?

  • @lomoabr1969
    @lomoabr1969 Před 2 měsíci

    pls can you give me a link to the github project

  • @HanifiNarmot
    @HanifiNarmot Před 2 lety +2

    how can i specify today's date

    • @coding_ideas
      @coding_ideas  Před rokem

      hello, Sorry for the delayed response.
      declare a static variable for your month and year in your
      main form, and assign a value.
      example :
      staticMonth = currentMonth;
      staticYear = currentYear;
      and in your UserControl Days.
      create current date variable
      example :
      currentDate = MainForm.staticMonth + "/" + lbday.text + "/" + MainForm.staticYear;
      and compare the currentDate and dateToday. if both are equal u can customize UserControl.

  • @bilecxyscambero8551
    @bilecxyscambero8551 Před rokem

    Necesito la base de datos 😭

  • @ramezamin9764
    @ramezamin9764 Před rokem

    Helllo, i want to add event with start date and finish date

  • @wait...5091
    @wait...5091 Před 7 měsíci

    please help, it does not display the name of the event on the calendar, although it is in the database

    • @wait...5091
      @wait...5091 Před 7 měsíci

      And also why you need a timer to open display event?

  • @ebrahimabd-elrazik24
    @ebrahimabd-elrazik24 Před rokem

    Hey!! you answered everyone except me and one or two people please help

    • @coding_ideas
      @coding_ideas  Před rokem

      hello, Sorry for the delayed response.
      declare a static variable for your month and year in your
      main form, and assign a value.
      example :
      staticMonth = currentMonth;
      staticYear = currentYear;
      and in your UserControl Days.
      create current date variable
      example :
      currentDate = MainForm.staticMonth + "/" + lbday.text + "/" + MainForm.staticYear;
      and compare the currentDate and dateToday. if both are equal u can customize UserControl.

  • @matias-5050
    @matias-5050 Před 2 lety

    Hi, the event doesn´t appear after i click the button add event

    • @coding_ideas
      @coding_ideas  Před 2 lety

      Check your timer :).

    • @matias-5050
      @matias-5050 Před 2 lety

      @@coding_ideas Ty brother ! , how can i update the year if i click next in december?

    • @coding_ideas
      @coding_ideas  Před 2 lety

      @@matias-5050 increment the year :). If its greater than 12 which is the month of december, add 1 to ur year .

    • @matias-5050
      @matias-5050 Před 2 lety

      @@coding_ideasyou mean : year ++; ?

    • @matias-5050
      @matias-5050 Před 2 lety

      @@coding_ideas It give me a exception : " The year, month, and day parameters describe a DateTime field that cannot be rendered.' "

  • @JeremyTelmoro
    @JeremyTelmoro Před 8 měsíci

    Help me pleaseeee 🥹