objConn = new System.Data.OleDb.OleDbConnection(connectStr);
objConn.Open();
CmdSend = objConn.CreateCommand();
CmdUpdateOK = objConn.CreateCommand();
CmdUpdateError = objConn.CreateCommand();
IF (CmdSend)
{
try
{
CmdSend.set_CommandText(strFmt(#LedgerJournalTransSelect, curext()));
ReaderSelect = CmdSend.ExecuteReader();
while(ReaderSelect.Read())
{
_InterfaceNo = strLRTrim(ReaderSelect.GetString(0));
When I run this method, the code doesn't proceed after ReaderSelect = CmdSend.ExecuteReader().
I checked the connection with external database is okay.
Please give me any advice what I should check?
Thanks.
*This post is locked for comments
Unfortunately I have no idea what you're trying to achieve with your code. I meant something like this:
System.Exception ex; try { ... } catch (Exception::CLRError) { ex = ClrInterop::getLastException(); if (ex != null) { ex = ex.get_InnerException(); if (ex != null) { error(ex.ToString()); } } }
Thanks Martin, and sorry for making you confused about version.
Yes, I'm talking about AX 2012.
Additionally, I put catch CLR Error like below to update when the codes make exception.
catch (Exception::CLRError) { CmdUpdateError.set_CommandText(strFmt(ledgerJournalTransErrorUpdate, 'E', this.DateTime(), _InterfaceNo, _GroupNo, _SeqNo, 'exception : CLRError')); }
But I couldn't get any result for it, because the connection with OLEDB is not constructed. What should I make code to get detail information or break through this problem.
Thanks.
I see you selected "current version" as the version tag, which used to be used for D365FO before it got a dedicated forum. Do you mean D365FO (I'll move your question to the right forum) or AX 2012?
I guess it's AX 2012 and you don't get any details about the exception because you don't catch CLRError exceptions anywhere. Please do it - knowing what problem you have will be a huge step forward.
By the way, please used the </> button in the rich formatting view to paste source code. It makes code easier to read.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156