You need to write query to get data for a given month. Try something like following:
SELECT
*
FROM
empreport
WHERE
MONTH(myDateColumn) = @SelectedMonthParam
Refer:
MSDN: MONTH (Transact-SQL)[
^]
NOTE 1: Make sure datatypes match. It returns integer , so pass integer from frontend.
NOTE 2: MONTH returns the same value as
DATEPART
(month, date).
BTW, the way you have implemented ADO.NET is open for SQL Injection. Read about protecting from SQL Injection here:
SQL Injection Mitigation: Using Parameterized Queries[
^]