I am new to AX 2009. I managed to build a report today using Visual Studio Dynamics AX reports. In my datamethod, I have this vb.net method to is used to populate my dataset:
<DataMethod(), AxSessionPermission(SecurityAction.Assert)> _
Public Shared Function DataMethod1(ByVal parmBalancesOver As String) As DataTable
Dim ds As DataSet
ds = SqlHelper.ExecuteDataset(“Server=xxxxxxx;Database=myDatabase;Integrated Security=SSPI”, CommandType.Text, "SELECT DISTINCT " & _
"CUSTTRANS.ACCOUNTNUM, CUSTTRANS.INVOICE, CUSTTRANS.AMOUNTCUR, CUSTTRANS.TRANSDATE, DateDiff(Day, CUSTTRANS.DUEDATE, GETDATE()) " & _
"AS PastDueDays, CUSTTABLE.NAME " & _
"FROM CUSTTRANS INNER JOIN " & _
"CUSTTABLE ON CUSTTRANS.ACCOUNTNUM = CUSTTABLE.ACCOUNTNUM " & _
"WHERE (CUSTTRANS.AMOUNTCUR >= " & parmBalancesOver & ") " & _
“ORDER BY CUSTTABLE.NAME”)
Return ds.Tables(0)
End Function
I am using the Microsoft Application Data Blocks to return a dataset using the ExecuteDataset method. The first parameter is the connection string. I normally do web development. In ASP.Net there is a file named web.config where you can store connection strings and then access them in your code by it’s name instead of the entire string. Is there anything in AX where I can store my connection strings and then use it’s name?
Bob