Hi
I am getting error when reading DateTime type data from list.
Getting error at line
DataTable dt = searchList.GetItems(query).GetDataTable();
Error : String was not recognized as a valid DateTime.Couldn't store <2010-08-31 17:00:00:000> in rt_start Column. Expected type is DateTime.
Here is my list structure
Field |
Data Type |
Values |
fieldId |
String |
1 |
Fieldname |
string |
abc |
pto_name |
string |
PDC |
rt_start |
DateTime |
2010-08-31 17:00:00:000 |
rt_end |
DateTime |
2011-08-31 17:00:00:000 |
Eid_address |
string |
The address data |
CAML Query that I am passing
<Where>
<And>
<Geq><FieldRef Name='rt_start' /><Value Type='DateTime' IncludeTimeValue='false'>4/28/2010 12:00:00 AM</Value></Geq>
<Eq><FieldRef Name='pto_name' /><Value Type='Text' >International</Value></Eq>
</And>
</Where>
query.ViewFields = string.Concat(
"<FieldRef Name= ‘fieldId'/>",
"<FieldRef Name= 'Fieldname' />",
"<FieldRef Name= ‘pto_name' />",
"<FieldRef Name= ‘rt_start' />",
"<FieldRef Name= ‘rt_end ' />",
@bhi