Need Sample Code for Accessing Axapta using C#

Manish.SharmaManish.Sharma Member Posts: 4
edited 2008-01-16 in Dynamics AX
Hi Pals,

I want to access the Axapta application using C# code. If someone has some of the sample solutions, please help me.

These samples will help me a lot as I am a complete Amateur in field of Programming :( .

Thanks in Advance...
With Regards,
Manish

Comments

  • pedroparrapedroparra Member Posts: 58
    You should use Axapta Business Connector. Look at google with Axapta Business Connector and c#.

    Here you have a sample but with visual basic:

    http://msdn2.microsoft.com/en-us/library/aa478711.aspx
  • Manish.SharmaManish.Sharma Member Posts: 4
    Thanks a lot buddy... It is definitely gonna help me... All the very best...
    With Regards,
    Manish
  • arijitbasuarijitbasu Member Posts: 19
    Hi,
    See if this helps u: Its in C# and is used to log in AX

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.Dynamics.BusinessConnectorNet;

    namespace SMSBCTest
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
    String company;
    String Language;
    String objectServer;
    String configuration;
    Axapta axapta1 = new Axapta();
    System.Net.NetworkCredential Proxy;
    String username;
    String domain;
    company = null;
    Language = "en-us";
    objectServer = "ARIJIT200792";
    configuration = "";
    username = "aribas951";
    domain = "IN.nam.ad.pwcinternal.com";
    Proxy = new System.Net.NetworkCredential("aribas951", "Password", domain);
    try
    {
    //axapta1.Logon(null, null, null, null);
    axapta1.LogonAs(username, domain, Proxy,null, null, null, null);
    MessageBox.Show("Success");
    }
    catch (Exception e1)
    {
    MessageBox.Show(e1.Message);
    }
    }
    }
    }



    Also see this link

    http://daxguy.blogspot.com/2007/05/dax- ... ector.html
    Arijit Basu
    MVP - Microsoft Dynamics AX
    http://daxguy.blogspot.com/
  • Manish.SharmaManish.Sharma Member Posts: 4
    Thank You Arjit...
    With Regards,
    Manish
Sign In or Register to comment.