# Solved: Conversion between C++ CTime to SQL DATETIME conversion



## AlbertB (Nov 24, 2002)

Hi guys. Can anyone point me to where I can find a method to convert from a C++ CTime object to a SQL DATETIME field and back in C++ ado.net managed code? I've dredged everywhere for almost a full day and can find nothing on it.

Unfortunately the help offered for many areas of C++ by M$ is becoming painfully thin and new processes to me seem to be becoming harder to find out about.

Thanks.


----------



## AlbertB (Nov 24, 2002)

It's ok now, I solved it myself. It turned out to be remarkably easy (once you know). CString is recognised intrinsically.

CString myString;
...
System::String^ strS = gcnew System::String(myString);


----------

