Hi,
I am doing an upgrade from NAV2009 to NAV2015, but on the Data Upgrade, I always get the following error (in german):
SessionId : 5124
CodeunitId : 104055
FunctionName : StartUpgrade
CompanyName : xxx
StartTime : 27.04.2016 16:16:31
Duration :
State : FailedPendingResume
Error : Fehler bei einem Aufruf von System.Data.SqlClient.SqlCommand.CommandText mit folgender Meldung: Das
Objekt mit dem Typ "System.String" kann nicht in den Typ "System.Int32" konvertiert werden.
(Error during a call to System.Data.SqlClient.SqlCommand.CommandText with the following message: the Object with the type "System.String" can not be converted in type "System. Int32".)
Any idea ?
Best regards.
0
Comments
try to split upgrade to smaler steps.
NAV2009 -> 2013
NAV2013 ->2015
Such errors mostly fixed as correction of data issues.
Th most hard code in upgrade toolkit is from 2009 to 2013.
So start NAV2009-> 2013 migration with debugger. I suppose you will catch an error.
Reports transformation to RDLC
List -1h , Complex List -3h, Document -4h (dev hours)
navisionupgrade.com
Did you find solution?
I've same issue. I'm find it happens during this call: UpgradeDimEntry.UpgradeTable(DATABASE::"Document Dimension",0);
I solve it.
It was problem with reusing SQLCommand variable in one function.
I fixed 3 functions in cu 104049 UpdateDimensionEntry:
function UpdateDimSetIdInWorkTables
...
// GG >>
// Before this line SQLCommand var in use without problem .
// But when I try to use it again, adding another query...
//SQLCommand.CommandText := UpdateDimEntryQry;
// After this line I'm getting error:
// the Object with the type "System.String" can not be converted in type "System. Int32"
//SQLCommand.ExecuteNonQuery;
// I added new var SQLCommandUpd (same as SQLCommand)
// and replaced code with next lines:
SQLCommandUpd := SQLCommandUpd.SqlCommand(UpdateDimEntryQry,SQLConnection);
SQLCommandUpd.CommandTimeout(0);
SQLCommandUpd.ExecuteNonQuery;
// GG <<
...
function UpdateParentTable
...
// GG >>
//SQLCommand.CommandText := UpdateLedgerEntryTableQry(ParentTableID,KeyOffset,0,DestDimFieldName);
//SQLCommand.CommandTimeout(0); // wait indefinitely for the command to finish.
//SQLCommand.ExecuteNonQuery;
SQLCommandUpd := SQLCommandUpd.SqlCommand(UpdateLedgerEntryTableQry(ParentTableID,KeyOffset,0,DestDimFieldName),SQLConnection);
SQLCommandUpd.CommandTimeout(0);
SQLCommandUpd.ExecuteNonQuery;
// GG <<
...
IF HasTableField(ParentTableID2,DestDimFieldName) AND AreDimKeyAndParentKeyCompatible(KeyOffset,ParentKeyOffset) THEN BEGIN
// GG >>
//SQLCommand.CommandText := UpdateLedgerEntryTableQry(ParentTableID2,KeyOffset,ParentKeyOffset,DestDimFieldName);
//SQLCommand.ExecuteNonQuery;
SQLCommandUpd := SQLCommandUpd.SqlCommand(UpdateLedgerEntryTableQry(ParentTableID2,KeyOffset,ParentKeyOffset,DestDimFieldName),sqlconnection);
SQLCommandUpd.CommandTimeout(0);
SQLCommandUpd.ExecuteNonQuery;
// GG <<
END ELSE
IF NOT AreDimKeyAndParentKeyCompatible(1,0) THEN
ERROR(STRSUBSTNO(Text001Err,DimTableID,ParentTableID2)); // TODO:ERROR(STRSUBSTNO(Text001,DimTableID,ParentTableID2),DimTableID,'');
...
function CleanupTables
...
// GG >>
//SQLCommandOnClient.CommandText := TruncateDimTableQry(DimTableID);
//SQLCommandOnClient.ExecuteNonQuery;
SQLCommandOnClientUpd := SQLCommandOnClientUpd.SqlCommand(TruncateDimTableQry(DimTableID),SQLConnectionOnClient);
SQLCommandOnClientUpd.CommandTimeout(0);
SQLCommandOnClientUpd.ExecuteNonQuery;
// GG <<
...
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n