fletchsod
Programmer
- Dec 16, 2002
- 181
The datetime data in MS-SQL is stored as miltary format but when I retrieve it from the database and assigned it to string, it get converted to standard format. I don't want standard format, i want it unchanged leaving it as military format.
Thanks...
Thanks...
Code:
sAsk = "";
sAsk += " SELECT CAST(LoginTimestamp AS DATETIME) AS LoginTimestamp FROM tblWebUsers_LoginManagement ";
sAsk += " WHERE UserID = '" + sUserId + "' ";
bSuccess = this.ftnDatabase_SelectQuery_DataSetFiller(sAsk, ref oDataSet, ref sErrorMsg);
if (bSuccess == false)
{
throw new Exception("Unable to retrieve data from database");
}
if (oDataSet.Tables[0].Rows.Count > 0)
{
sOldLoginTimestamp = Convert.ToString(oDataSet.Tables[0].Rows[0]["LoginTimestamp"]);
}