DateTime in sharepoint 2007
I am fetching list date item in string variable then I want to insert it in SQL table,but in SQL the column type is datetime
So I need to convert string to datetime
I am using below code

DateTime strAllocatedOn; 
string[] format = { "dd/MM/yyyy HH:mm:ss tt", "dd-MM-yyyy HH:mm:ss tt" };
DateTime.TryParseExact(dt.Rows[j]["Created".ToString(), format, null, DateTimeStyles.None, out strAllocatedOn);

but getting below error
An error occurred during the compilation of the requested file, or one of its dependencies. Invalid expression term 'out' 

date format which I am receving is " 10/3/2011 4:38:27 PM "

Please suggest me if any possible solution

Thanks in advance
Rushikesh

DateTime in sharepoint 2007
===

I am fetching list date item in string variable then I want to insert it in SQL table,but in SQL the column type is datetime
So I need to convert string to datetime
I am using below code

DateTime strAllocatedOn; 
string[] format = { "dd/MM/yyyy HH:mm:ss tt", "dd-MM-yyyy HH:mm:ss tt" };
DateTime.TryParseExact(dt.Rows[j]["Created".ToString(), format, null, DateTimeStyles.None, out strAllocatedOn);

but getting below error
An error occurred during the compilation of the requested file, or one of its dependencies. Invalid expression term 'out' 

date format which I am receving is " 10/3/2011 4:38:27 PM "

Please suggest me if any possible solution

Thanks in advance
Rushikesh
