C# Customization Error After Upgrade

I am working on a customization with the same issue after the upgrade. In my previous code I was using a line very similar to yours to pull a value from a BAQ that returns a single value.

Previously this worked:

private int getLastUNID()
{
using (var svc = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.DynamicQueryImpl>((Ice.Core.Session)oTrans.Session,Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.DynamicQuerySvcContract>.UriPath))
		{
			var qeds = new QueryExecutionDataSet();
			DataSet baq = svc.ExecuteByID("LastCPIUNID", qeds);
			if (Convert.ToString(baq.Tables["Results"].Rows[0]["Calculated_LastUNID"]) == "")
				{			
				return 0;
				}
			else
			{
			return (int)baq.Tables["Results"].Rows[0]["Calculated_LastUNID"];
			}
		}
}

So I referred to this post and found your link. After trying the syntax on that page, I have the following:

private int getLastUNID()
{
		DynamicQueryAdapter qry = new DynamicQueryAdapter(oTrans); 
	
		qry.BOConnect();
		DataSet baq = qry.ExecuteByID("LastCPIUNID");	
	    DataSet ds = qry.QueryResults;
		qry.Dispose();	
			
			if (Convert.ToString(ds.Tables["Results"].Rows[0]["Calculated_LastUNID"]) == "")
				{			
				return 0;
				}
			else
				{
				return (int)ds.Tables["Results"].Rows[0]["Calculated_LastUNID"];
				}	
}

But now I am getting an error on the DataSet baq = … line

 Error: CS0029 - line 273 (859) - Cannot implicitly convert type 'void' to 'System.Data.DataSet'

What am I missing?