Auto Time Table Part 31 Generate Time Tables

Auto Time Table Part 31 Generate Time Tables

Hi, Dear's here we learn how to implement Auto Time Table Generator in Visual Studio using C# Windows Form. Ilyasoft software company provide full project step by step training on our YouTube Channel ilyasoft software company so now subscribe, share and like for more project base tutorials


In this video we execute GenerateTimeTablesForAllSession(store procedure) to generate time tables :

steps : 
    > Create Window Form - Add DateTimePicker to pass start-date and end-date.
    > Add Button to generate time tables. 

Source Code C#:

// Code to execute GenerateTimeTablesForAllSession store procedure in c#.

 public class GenerateTimeTable
   {
        public static string AutoGenerateTimeTable(DateTime StartDate, DateTime EndDate)
        {
            string Messages = string.Empty;
            try
            {
                SqlCommand command = new SqlCommand("GenerateTimeTablesForAllSession", DatabaseLayer.ConOpen());
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@StartDate", StartDate);
                command.Parameters.AddWithValue("@EndDate", EndDate);
                SqlParameter RuturnValue = new SqlParameter("@Message", SqlDbType.NVarChar,200);
                RuturnValue.Direction = ParameterDirection.Output;
                command.Parameters.Add(RuturnValue);
                command.ExecuteNonQuery();
                Messages = (string)command.Parameters["@Message"].Value;
            }
            catch (Exception ex) 
            {
                Messages = ex.Message;
            }
            return Messages;
        }
    }


// Code on Generate Time Table button.

private void btnAutoGenerateAllTimeTable_Click(object sender, EventArgs e)
        {
            try
            {
                ep.Clear();
                string message = GenerateTimeTable.AutoGenerateTimeTable(dtpFromDate.Value, dtpToDate.Value);
                MessageBox.Show(message);
                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        } 


Comments

  1. no info occur in detail table after running the program ,only the info of tbl table occure and message box telling me the time table generated successfully please help

    ReplyDelete
    Replies
    1. dear, if your issue is still, then txt on whatsapp +923143076781

      Delete

Post a Comment