locked
Sliding Data RRS feed

  • Question

  • Hi,

    I am using C# in WinForm to display employee birthdays on the screen as you can see in below image. My problem is when there are two birthdays in the same day so I thought to show them as slideshow

    How can I do that please?

    here is my code to get the data:

    void GetCalendar()
    {
        using (sql_connection = new MySqlConnection(connectionString))
        {
            if (sql_connection.State == ConnectionState.Closed)
            {
                sql_connection.Open();
            }
    
            sql_command = new MySqlCommand("sp_populate_calendar", sql_connection);
            sql_command.CommandType = CommandType.StoredProcedure;
            sql_command.Parameters.AddWithValue("@param_day", DateTime.Today.Day);
            sql_command.Parameters.AddWithValue("@param_month", DateTime.Today.Month);
            sql_command.Parameters.AddWithValue("@param_year", DateTime.Today.Year);
    
            using (sql_reader = sql_command.ExecuteReader())
            {
                if (sql_reader.HasRows)
                {
                    while (sql_reader.Read())
                    {
                        string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                        string file = Convert.ToString(sql_reader["file_name"]);
                        string logo_name = path + @"\AJCItv\Logo.png";
                        string full_name = path + @"\AJCItv\" + file;
    
                        LabelTitle.Text = Convert.ToString(sql_reader["calendar_title"]);
                        LabelName.Text = Convert.ToString(sql_reader["calendar_name"]);
    
                        if (sql_reader["file_name"] != DBNull.Value && File.Exists(full_name))
                        {
                            PictureCalendar.ImageLocation = full_name;
                        }
                        else
                        {
                            PictureCalendar.ImageLocation = logo_name;
                        }
                    }
    
                    PanelHeader.Visible = true;
                }
                else
                {
                    PanelHeader.Visible = false;
                }
            }
        }
    }
    


    Wednesday, November 11, 2020 6:05 AM

All replies