Welcome to MSDN Blogs Sign in | Join | Help

Programatically reading data from AxDataSourceControl

DataSourceControl makes it simple to get Ax data and display it in DataBound UI controls and manipulate the data. You can also use them to read data programtically. Below is one way of doing it. The other way to get Ax data programatically is to get the DataSet directly using MetaDataCahce object and reading data.

 

private void GetData()

      {

 

            DataSourceViewSelectCallback callback = new DataSourceViewSelectCallback(PrintData);

              AxDataSource1.GetDataSourceView("CustTable").Select(DataSourceSelectArguments.Empty,callback);

   

      }

 

    private void PrintData(IEnumerable data)

    {

        IEnumerator i = data.GetEnumerator();

        while (i.MoveNext())

        {

            Response.Write(DataBinder.Eval(i.Current, "AccountNum").ToString() + “<BR/>”);

        }

    }

Published Thursday, November 06, 2008 8:51 PM by meysun
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Programatically reading data from AxDataSourceControl | Tmao Coders

# re: Programatically reading data from AxDataSourceControl

Thursday, November 20, 2008 11:26 AM by guido de jong

Dear Mey,

Is it a good idea to use genuine ASP.NET controls or third-party .NET controls as opposed to the AX WebUI controls (AX2009) in case the EP AX controls do not offer sufficient functionality? What about next versions of Dynamics AX, will they still support objects like AxaptaRecord?

guido de jong

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker