When using a DataTable for output in a .Net AEP, how do I set the Output Parameter? What data type is used?
Thanks,
Howard
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are you wanting to just pass back the datatable as is to use in your application or are you wanting to pass back the equivalent of the datatable to the __output table the AEP uses to return the resultset?
If the datatable directly you could setup an output parameter of type memo and then insert into __output the XML of the datatable (you will probably need to use a stringwriter so you don’t have to save it to a file)
Otherwise, the AEP will need to have one output parameter per column of your datatable. The types should be the same (in other words, if your datatable has int, char, int then your output parameters should be int, char, int).
In the AEP insert the values from your datatable into the __OUTPUT table. (i.e. add the datatable to a dataset, create a dataadapter and create the insert command using the commandbuilder then use dataadapter.update(dataset))