K
Kevin
Hi All
I am having a problem retrieving a Date value from an
Access 2000 database using the OLEDbProvider. Can someone
tell me please how to create a DateTime Object with the
date fro m the Database, I need the database date to
subtract it from another date I have to gain the number
of days that have elapsed. I just cannot seem to get this
DateTime thing correct. The field in my Access Database
is defined as a short date. This is kind of what I
tried :
DateTime EmpShStart =new DateTime();
foreach (DataRow dr in ds911.Tables
["Employees"].Rows)
{
EmpShStart = Convert.ToDateTime(dr.Table.Columns
["ShiftStartDate"]),"d",CultureInfo.CurrentCulture,DateTim
eStyles.NoCurrentDateDefault);
}
but that doesn't work, I have tried numerous
combinations, but all of them throw an exception! any
ideas?
Also Can someone Please direct me to a site or something
that actually explains the DateTime class very well,
becasue I have such problems creating objects of the
Datetimes class. I think it would be helpful if I could
read some material that explains the DateTime class in
simple english so that I can understand it well, so that
in the future I don't have these hassles.
Thanks very much for any help
Kevin
I am having a problem retrieving a Date value from an
Access 2000 database using the OLEDbProvider. Can someone
tell me please how to create a DateTime Object with the
date fro m the Database, I need the database date to
subtract it from another date I have to gain the number
of days that have elapsed. I just cannot seem to get this
DateTime thing correct. The field in my Access Database
is defined as a short date. This is kind of what I
tried :
DateTime EmpShStart =new DateTime();
foreach (DataRow dr in ds911.Tables
["Employees"].Rows)
{
EmpShStart = Convert.ToDateTime(dr.Table.Columns
["ShiftStartDate"]),"d",CultureInfo.CurrentCulture,DateTim
eStyles.NoCurrentDateDefault);
}
but that doesn't work, I have tried numerous
combinations, but all of them throw an exception! any
ideas?
Also Can someone Please direct me to a site or something
that actually explains the DateTime class very well,
becasue I have such problems creating objects of the
Datetimes class. I think it would be helpful if I could
read some material that explains the DateTime class in
simple english so that I can understand it well, so that
in the future I don't have these hassles.
Thanks very much for any help
Kevin