hello, i want to ask how to run SQL command directly on ax use this method.
it runs and get force close with no error
private void updateFromLargo(/*EU_TBL_PembagianLargoAXTmp _updateSTG*/)
{
str queryUpd;
EU_CLS_PembagianlargoAXconnect updateLargo = EU_CLS_PembagianlargoAXconnect::construct();
System.Exception exception;
System.Data.SqlClient.SqlConnection connection;
System.Data.SqlClient.SqlCommand command;
System.Data.SqlClient.SqlDataReader dataReader;
connection = updateLargo.getConnectionLargo();
queryUpd = strFmt( "UPDATE A " +
"SET [QTYSET] = B.[QTYSET], " +
"[QTYPCS] = B.[QTYSET] * B.[CYLFN2] " +
"FROM [AXDEV].[MicrosoftDynamicsAX].[dbo].[EU_TBL_PembagianLargoAXTmp] " +
"A INNER JOIN " +
"[BarcodeStaging].[dbo].[AXLABELFN2RESULT] B " +
"ON A.[PRODIDFN2] = B.[PRODID]" ); >> i only want to run this command on sql server using class ax 2012
command = new System.Data.SqlClient.SqlCommand(queryUpd, connection);
dataReader = command.ExecuteReader(); >> already use debugger and after this it force close
dataReader.Close();
connection.Close();
}
i know if datareader is empty on > private void updateFromLargo(/*EU_TBL_PembagianLargoAXTmp _updateSTG*/) it will become error.
but can i have another solution using this method to run only SQL command ?
THANKS IN ADVANCE