DateTime date1, date2;
date1 = Convert.ToDateTime(DateTime.Now.Month + "/1/" + DateTime.Now.Year);
date2 = Convert.ToDateTime(DateTime.Now.Month + "/" + DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) + "/" + DateTime.Now.Year);
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=AnbarDB;Integrated Security=True");
SqlCommand com = new SqlCommand();
SqlDataReader oldr;
DataTable Table = new DataTable();
con.Open();
com.Connection = con;
com.CommandText = "SELECT Nfact, Kala, Price, Andaze, Kol, Mande, Dat FROM TBuy WHERE Dat Between @d AND @d2";
com.Parameters.AddWithValue("@d", date1);
com.Parameters.AddWithValue("@d2", date2);
oldr = com.ExecuteReader();
Table.Load(oldr);