I tried comparing using the below codes but it failed to work. Did I do the wrong way to compare datetime? The data type in my sql table is datetime for both Premium_StartDate and Premium_EndDate. Please help, thanks
SqlCommand cmd = new SqlCommand("SELECT * FROM UserPremiumPeriod WHERE Premium_Username = '" + Session["username"] + "' AND Premium_StartDate <= '" + DateTime.Now + "' AND Premium_EndDate >= '" + DateTime.Now + "' ", con);