Ax logon in Visual Studio by using .Net Bunicess Connector

Hi Everybody,

Iam trying to log on to AX 2012 by adding .dll reference into AX.

I wrote a code to insert a single record into Table

Code is…

using (Axapta objAx = new Axapta())
{
string aosConnString = string.Format("{0}@{1}:{2}", “DAX_AOS_2012”, “AX2012”, “2713”);

objAx.LogonAs(“bcproxy”, “teamserver”,
new NetworkCredential(“bcporxy”, “Memory@123”, “teamserver”),
“dat”, “”, aosConnString, “”);
MessageBox.Show(objAx.Session().ToString());

var header = objAx.CreateAxaptaRecord(“Table2”);
objAx.TTSBegin();
header.Clear();
header.set_Field(“SID”, “San10”);
header.Insert();
objAx.TTSCommit();
objAx.Logoff();

}

Please suggest me where i went wrong…I updated the dll using GACUTIL and added its reference and tried to executing the code…But it doesn’t work.

please help me in resolving this

Dear Vinay,

I am also facing same issue.

Hi Vinay,

Code seems fine, is logon successful? could you please provide error message what you are getting.

-Ambanna

Hi Yatnal,

Iam not getting any error in this case…At the same time code below the Logon is not working