Code Snippet
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
int month = int.Parse(monthCalendar1.SelectionStart.Month.ToString());
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=(local);Initial Catalog=book;Integrated Security=True";
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from bookdetail where publishMonth="+month, conn);
DataTable dt=new DataTable();
da.Fill(ds);
lstBook.Columns.Add("ID");
lstBook.Columns.Add("Name");
lstBook.Columns.Add("Author");
for (int i = 0; i < dt.Rows.Count; i++)
{
ListViewItem item = new ListViewItem();
item.SubItems.Add(dt.Rows[i]["ID"].ToString());
item.SubItems.Add(dt.Rows[i]["Name"].ToString());
item.SubItems.Add(dt.Rows[i]["Author"].ToString());
this.lstBook.Items.Add(item);
}
}