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/>”);
}
}
Comments
Anonymous
November 06, 2008
PingBack from http://www.tmao.info/programatically-reading-data-from-axdatasourcecontrol/Anonymous
November 20, 2008
The comment has been removed