C# Error: CS0266


(system) #1

I'm doing something daft but don't know how to fix it. Here's the snippet of code that's giving me trouble 


PartAdapter adapterPart = new PartAdapter(this.oTrans); 

adapterPart.BOConnect(); 


// Declare and Initialize Variables 

// Declare and Initialize Variables 

string proposedProdCode = lvGroup; 

Epicor.Mfg.UI.Searches.DataSetMode dsMode; 


Epicor.Mfg.BO.PartDataSet ds = adapterPart.GetCurrentDataSet(dsMode); 


// Call Adapter method 

adapterPart.ChangePartProdCode(proposedProdCode, ds); 


lvGroup contains the new ProdCode 


However when I test the code I get the following message 


Error: CS0266 - line 291 (2254) - Cannot implicitly convert type 'System.Data.DataSet' to 'Epicor.Mfg.BO.PartDataSet'. An explicit conversion exists (are you missing a cast?) 


which relates to the line: 


Epicor.Mfg.BO.PartDataSet ds = adapterPart.GetCurrentDataSet(dsMode); 


So the question is what am I doing wrong and is it even possible to do what I'm trying