M
Mike
Hi,
I use MS SQL Express and VS 2005 c#, win application.
I would like to select value rom DateTimePicker and list all values
for selected date within GridView.
I have method as follows:
public DataTable GetOffersForDate_A(DateTime OfferDate)
{
DataTable dt = new DataTable();
if (aConnection.State == ConnectionState.Closed)
aConnection.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand(@"SELECT * FROM tblOffer
WHERE OfferDate = " + OfferDate, aConnection);
da.Fill(dt);
return dt;
}
Problem is, it is my conclusion, may be is wrong, in following:
one value looks like:
26.11.2007 00:00:00
and another one is something like this:
26.11.2007 07:35:23
As we can see this is not the same time value. For me time is not
important, I want to find only rows based on date selected in
DateTimePicker.
Furthermore, I am not sure that this is the best apporach.
How I can do this?
Thanks
I use MS SQL Express and VS 2005 c#, win application.
I would like to select value rom DateTimePicker and list all values
for selected date within GridView.
I have method as follows:
public DataTable GetOffersForDate_A(DateTime OfferDate)
{
DataTable dt = new DataTable();
if (aConnection.State == ConnectionState.Closed)
aConnection.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand(@"SELECT * FROM tblOffer
WHERE OfferDate = " + OfferDate, aConnection);
da.Fill(dt);
return dt;
}
Problem is, it is my conclusion, may be is wrong, in following:
one value looks like:
26.11.2007 00:00:00
and another one is something like this:
26.11.2007 07:35:23
As we can see this is not the same time value. For me time is not
important, I want to find only rows based on date selected in
DateTimePicker.
Furthermore, I am not sure that this is the best apporach.
How I can do this?
Thanks