I have Following Procedure

alter  PROCEDURE GET_REQUEST_FOR_LEAVE_N_ATTENDANCE
@ENAME VARCHAR(100),
@FR_DT DATETIME,
@TO_DT DATETIME
AS
BEGIN 
SET NOCOUNT ON 
	SELECT B.CEMPLOYEE_NAME,A.* FROM TRN_EMPLOYEE_ATTENDANCE_REQUEST A
	INNER JOIN MST_EMPLOYEE B
	ON A.EMPLOYEE_ID   = B.EMPLOYEE_ID 
	WHERE B.CEMPLOYEE_NAME LIKE '%' + @ENAME + '%'
	AND ABSENT_DATE BETWEEN @FR_DT AND @TO_DT

	SELECT B.CEMPLOYEE_NAME,A.* FROM TRN_LEAVE_REQUEST A
	INNER JOIN MST_EMPLOYEE B
	ON A.EMPLOYEE_ID   = B.EMPLOYEE_ID  
	WHERE B.CEMPLOYEE_NAME LIKE '%' + @ENAME + '%'
	AND REQUESTED_FOR BETWEEN @FR_DT AND @TO_DT
END

when i run this procedure on Microsoft SQl server manager on output window it shows two
output for this procedure.
Same i want to store in two gridview
How can i do the same

Member Avatar for stbuchok

If you return the data into a DataSet you will have 2 DataTables in the DataSet, each of which can be bound to a separate GridView.

stbuchok thanks for giving your time
I got my own solution for the same

connstr.Open();
                SqlCommand cmd = new SqlCommand("GET_REQUEST_FOR_LEAVE_N_ATTENDANCE",connstr);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ENAME", InitialName);
                cmd.Parameters.AddWithValue("@FR_DT", frmDate);
                cmd.Parameters.AddWithValue("@TO_DT", toDate);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);
                dataGridView1.DataSource = ds.Tables[0];
                dataGridView2.DataSource = ds.Tables[1];
Member Avatar for stbuchok

Yeah, that's kind of exactly what I said.

Thanks for Reply
NOw i have one problem
that means i added checkbox column in datagridview
And if the user check the few rows then i want to delete that columns only
How can i achieve the same
in window forms

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.