I’m hoping someone can spot the novice mistake I’m clearly making as I test returning a dataset from a simple function. I’ve made numerous attempts at the datacolumns to datatable to dataset constructions and I still receive the dreaded “Generic error”. I’m sure it has to do with the way I’m handling the DataSet, but I’ve searched all over the info nets and now am forced to cry Uncle!

DataTable tbl = new DataTable();
tbl.Columns.Add("OrderNum", typeof(int));
tbl.Columns.Add("OrderRel", typeof(int));
tbl.Columns.Add("OrderLine",typeof(int));
tbl.Columns.Add("PartNum", typeof(string));
tbl.Columns.Add("ItemQty",typeof(int));
tbl.Columns.Add("JobNum", typeof(string));
var dtlrows = (from j in Db.JobProd where j.OrderNum == inOrderNum select new {j.OrderNum, j.OrderRelNum, j.OrderLine, j.PartNum, j.ProdQty, j.JobNum} );
string orderDtls = "";
if(dtlrows !=null)
{
foreach (var dr in dtlrows)
{
orderDtls += "\r\n" + dr.OrderNum + "~" + dr.OrderLine + "~" + dr.PartNum + "~" + dr.JobNum + "~" + dr.ProdQty ;
tbl.Rows.Add(dr.OrderNum, dr.OrderRelNum, dr.OrderLine, dr.PartNum, dr.ProdQty, dr.JobNum);
}
}
output = orderDtls;
dsOutput.Tables.Add("tbl");
The code editor is happy…

But the Postman is not…
I know that data is present as the string value returns data when I comment out the DataSet stuff. Oh… I’ve also tried the Tables.Add() without quotes around the table name.
