views:

27

answers:

1

When using a DataTable for output in a .Net AEP, how do I set the Output Parameter? What data type is used?

Thanks,

Howard

+2  A: 

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))

Edgar
Thanks for the help,Howard
hsedidin