У меня есть следующая ситуация. Это: < /p>
Код: Выделить всё
System.Globalization.CultureInfo cultureEN = new System.Globalization.CultureInfo("en-GB");
currentDeepSightVuln.LastUpdated = DateTime.Parse(n_alertdocument.SelectSingleNode("./x:LastUpdated", nsmgr).InnerText, cultureEN);
< /code>
В моем файле XML это поле: < /p>
2014-05-21T17:00:38
Запуск моей программы, когда она выполняется предыдущая операция (инициализируя свойство объекта LostUpdate). 17:00:38} .
Как видите, есть другой формат, чем значение поля XML. Я думаю, что это довольно нормально, потому что он преобразуется, основывая его на параметрах en-gb . Мой объект в DB Я использую что-то подобное: < /p>
Код: Выделить всё
public long insert(DataModel.Vulnerability.Vuln v)
{
_strSQL = "";
string strSQLParametri = "";
string query = "";
long newId;
long VulnerabilityAlertDocumentPkValue;
System.Data.Common.DbCommand command;
command = _connection.CreateCommand();
try
{
_transactionBegin();
// [VulnerabilityAlertId] insertion on the DB:
if (v.VulnerabilityAlertId != null)
{
_strSQL = "INSERT INTO VulnerabilityAlertDocument ( [VulnerabilityAlertId] ";
strSQLParametri = " VALUES (@VULNERABILITYALERTID ";
_addParameter(command, "@VULNERABILITYALERTID ", newId);
}
........................................................................
........................................................................
........................................................................
_strSQL += ",[PUBLISHED] ";
strSQLParametri += ", @PUBLISHED ";
_addParameter(command, "@PUBLISHED", v.Published);
........................................................................
........................................................................
........................................................................
query = _strSQL + " ) " + strSQLParametri + " );";
command.CommandText = query;
_executeNoQuery(command);
VulnerabilityAlertDocumentPkValue = _getIdentity();
Debug.WriteLine("PK della tabella VulnerabilityAlertDocumentPkValue: " + VulnerabilityAlertDocumentPkValue);
Подробнее здесь: https://stackoverflow.com/questions/241 ... sql-server