Please forgive my ignorance. I am picking up where a previous co-worker left off working on a console application in C#. I can use the following code to get a list of id's but the results come back with attributes of type, url and id. I need to put a
list of just the id's into a datatable. That way I can loop through each id in the datatable. How can I do this?
Task<QueryResult<dynamic>> program_id = client.QueryAsync<dynamic>("SELECT id FROM Programs");
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
33 Points
110 Posts
How Do I Load Datatable in C# from Query using QueryAsync
Feb 02, 2021 03:28 AM|rhondadunn|LINK
Please forgive my ignorance. I am picking up where a previous co-worker left off working on a console application in C#. I can use the following code to get a list of id's but the results come back with attributes of type, url and id. I need to put a list of just the id's into a datatable. That way I can loop through each id in the datatable. How can I do this?
Contributor
2770 Points
789 Posts
Re: How Do I Load Datatable in C# from Query using QueryAsync
Feb 02, 2021 08:37 AM|YihuiSun|LINK
Hi rhondadunn,
"QueryAsync" seems to be your custom method.
Do you want to take out the value of program_id and add them to the DataTable?
var value = program_id.Result;
Best Regards,
YihuiSun