private DataTable MonthlyAttendanceReport() { SqlCommand cmd = new SqlCommand("UIPKGREPORTING_spFetchMonthlyAttendanceReport", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@inVolunteerID", SqlDbType.Int).Value = drp_Volunteer.SelectedValue; cmd.Parameters.AddWithValue("@inType", drp_Type.Text); cmd.Parameters.AddWithValue("@inShift", drp_Shift.Text); cmd.Parameters.AddWithValue("@inFromDateTime", dtp_Year.Value); cmd.Parameters.AddWithValue("@inToDateTime", dtp_Month.Value); cmd.Parameters.Add("@inPoints", SqlDbType.Int).Value = -1; SqlDataAdapter sda = new SqlDataAdapter(cmd); DataSet dt = new DataSet(); sda.Fill(dt, "abc"); dataGridView1.DataSource = dt.Tables["abc"].DefaultView; labeltc.Text = dt.Tables["abc"].Rows.Count.ToString(); return dt.Tables["abc"]; }
I Have 2 dtp_Year in this Format "2022"; & Month Format "May"