Customization - Inspection Processing Adapter Incompatible Datasets

Hey there,

I’m instantiating an adapter and getting the dataset okay. Then if I turn right around and try to run the inspection update it tells me the dataset isn’t the right kind:

		InspProcessingAdapter inspProcessingAdapter  = new InspProcessingAdapter(oTrans);
		inspProcessingAdapter.BOConnect();
		
		SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
		opts.PreLoadSearchFilter = ""; //Company = 'DNP01'"; 
		opts.DataSetMode = DataSetMode.RowsDataSet;
		
		bool morePages = false;

		// Erp.BO.InspProcessingDataSet
		// System.Data.DataSet
		var dsInspProcessing = inspProcessingAdapter.GetList(opts, out morePages);

		// see whether dataset is good
		string legalNumberMessage = "";
		int iDMRNum = 0;

		inspProcessingAdapter.InspectInventory(out legalNumberMessage, out iDMRNum, dsInspProcessing);

Error: CS1502 - line 135 (402) - The best overloaded method match for 'Erp.Adapters.InspProcessingAdapter.InspectInventory(out string, out int, Erp.BO.InspProcessingDataSet)' has some invalid arguments
 Error: CS1503 - line 135 (402) - Argument 3: cannot convert from 'System.Data.DataSet' to 'Erp.BO.InspProcessingDataSet'

And here’s the key:

versus:

The GetRows (and GetList) returns a System.Data.DataSet, and the InspectInventory wants Erp.BO.InspProcessingDataSet.

What The Heck would one do here?

Thanks,

Joe

The adapter should carry the data with it after you call GetRows

Try this;

private void epiButtonC1_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
var inspProcessingAdapter = new InspProcessingAdapter(oTrans);
inspProcessingAdapter.BOConnect();
bool morePages = false;

SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
opts.PreLoadSearchFilter = “”; //"InspectionPending=‘true’ ";
opts.DataSetMode = DataSetMode.RowsDataSet;

inspProcessingAdapter.GetRows(opts, out morePages);
//var dsInspProcessingBO = dsInspProcessing.InspProcessingData;
// see whether dataset is good
string legalNumberMessage = “”;
int iDMRNum = 0;

inspProcessingAdapter.InspectInventory(out legalNumberMessage, out iDMRNum, inspProcessingAdapter.InspProcessingData);

}

Thanks, Aaron. I’ll give it a try.

Joe

So here’s some progress, and a hiccup.

With this code:

InspProcessingAdapter inspProcessingAdapter  = new InspProcessingAdapter(oTrans);
inspProcessingAdapter.BOConnect();

SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
opts.PreLoadSearchFilter = ""; //Company = 'DNP01'"; 
opts.DataSetMode = DataSetMode.RowsDataSet;

bool morePages = false;

// Erp.BO.InspProcessingDataSet
// System.Data.DataSet

inspProcessingAdapter.GetRows(opts, out morePages);

Erp.BO.InspProcessingDataSet dsInspProcessing = inspProcessingAdapter.InspProcessingList; //InspProcessingData;

MessageBox.Show("count " + inspProcessingAdapter.InspProcessingList.InspNonConf.Rows.Count.ToString());

this.grdInspection.Visible = true;

grdInspection.DataSource = inspProcessingAdapter.InspProcessingList.InspNonConf; //dsInspProcessing;

grdInspection.DataBind();

The dataset is agreeable to the inspProcessingAdapter.InspectInventory method. But now I’m not getting any records in the dataset.

The message box above shows a count of zero, but the trace shows it reading a full dataset.

I’ve bound the dataset and individual tables in the adapter as the datasource to the grid (as shown above). I get column headings, but no data.

Sure I’m missing something.

Thanks,

Joe

GetRows returns to xxxxxData while GetList returns to xxxxxList

1 Like

or if you have the tranID…

InspProcessingAdapter _inspa = new InspProcessingAdapter(oTrans);
_inspa.BOConnect();
_inspa.GetByID((int)edv.dataView[edv.Row]["TranID"]);

Thanks, all.

This thing’s killing me.

So using “inspProcessingAdapter.GetList(opts, out morePages)” returns almost immediately, gives me no records in the trace, dataset, or adapter.

“inspProcessingAdapter.GetRows(opts, out morePages)” takes a bit to complete, and fills the trace with data. But no records in the dataset or adapter.

If I do a “inspProcessingAdapter.GetByID(22769)” I get a single record in the dataset and adapter and one row in the grid. (A good sign, I think.)

If I follow the GetByID immediately followed by GetRows as shown below I still get only a single row (tranID 22769) in the dataset adapter and grid. The trace shows the single record retrieved with the GetByID followed by the full list of records retrieved with the GetRows.

How can it perform the GetRows and still have the data retrieved by the GetByID in the adapter? Why isn’t the adapter being populated (other than column headers) when the data’s in the trace?

Thanks,

Joe

		InspProcessingAdapter inspProcessingAdapter  = new InspProcessingAdapter(oTrans);
		inspProcessingAdapter.BOConnect();
		
		SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
		opts.PreLoadSearchFilter = ""; //Company = 'DNP01'"; 
		opts.DataSetMode = DataSetMode.RowsDataSet;
		
		bool morePages = false;

		// Erp.BO.InspProcessingDataSet
		// System.Data.DataSet

		inspProcessingAdapter.GetByID(22769);

		inspProcessingAdapter.GetRows(opts, out morePages); // it doesn’t seem to matter whether this is commented

		Erp.BO.InspProcessingDataSet dsInspProcessing = inspProcessingAdapter.InspProcessingData; //InspProcessingData;

	MessageBox.Show("count " + dsInspProcessing.Tables[0].Rows.Count.ToString()); // count 1

	MessageBox.Show("count " + inspProcessingAdapter.InspProcessingData.InspProcList.Rows.Count.ToString()); // count 1


		this.grdInspection.Visible = true;

		grdInspection.DataSource = inspProcessingAdapter.InspProcessingData.InspProcList;  // a single row displayed (tranID 22769)

		grdInspection.DataBind();

It sounds like there is a grid involved to display data and then a record loaded into the form.
Perhaps a combo of querying for records via BAQ and displaying them on the grid would work, followed by performing inspection processing adapter specific transactions via the adapter?

I might have to do that. I can read in the data if I do something like:

*System.Data.DataSet dsInspProcessing* = inspProcessingAdapter.GetRows(opts, out morePages);

But the actual inspection update process needs the dataset type Erp.BO.InspProcessingDataSet. That’s where we’re hanging up.

I guess I can read them in a regular dataset and update them one at a time with a GetById.

Thanks for the reminder.

Joe

You can store the results in your own dataset, then merge them back into the adapter dataset.