Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem updating the list with date time type

Status
Not open for further replies.

john121

Programmer
Oct 18, 2007
9
0
0
GB
Hi
I am trying to update my document library list item and for some reason this is not updating.

I think the problem lies in docdate, which is of datetime type. I have tried with various date formats but no luck so far.

could any one please let me know what i am doing wrong here.

here is the code i am using

Code:
string strTest = "2/16/1992 12:15:12";  
DateTime docdate= DateTime.Parse(strTest);


// Create CAML script to update list item 
String sBatch = String.Format(@"<Method ID='1' Cmd='Update'>" 
+ @"<Field Name='ID'>{0}</Field>" 
+ @"<Field Name='FileRef'>{1}</Field>" 
+ @"<Field Name='FromEmailAddress'>{2}</Field>" 
+ @"<Field Name='DocumentDate'>{3}</Field>" 
+ @"</Method>", id, url, email, docdate);

thanks for any help

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top