Guest User

Guest User

  • Tech Writer
  • 529
  • 40.5k

Search Data With combox,type,shift,FromDate,Todate,Points

Apr 28 2022 10:07 PM

SqlCommand cmd = new SqlCommand("UIPKGREPORTING_spFetchAttendanceReport", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@inType", drp_Type.Text);
            cmd.Parameters.AddWithValue("@inShift", drp_Shift.Text);
            cmd.Parameters.AddWithValue("@inFromDateTime", dtp_FromDate.Value);
            cmd.Parameters.AddWithValue("@inToDateTime", dtp_ToDate.Value);
            cmd.Parameters.Add("@inPoints", SqlDbType.Int).Value = -1;
            cmd.Parameters.Add("@inVolunteerID", SqlDbType.Int).Value = 0;
            //int UserId = Convert.ToInt32(cmd.Parameters["@inVolunteerID"].Value);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            DataSet dt = new DataSet();
            sda.Fill(dt, "abc");
            dt.Tables["abc"].Columns.Remove("attendancelogid");
            dt.Tables["abc"].Columns.Remove("TotalDuration");
            dataGridView1.DataSource = dt.Tables["abc"].DefaultView;
            return dt.Tables["abc"];

==============================================================================

Search Data In DataGridView 

Send Me Code 

Thank You...


Answers (1)