Search code examples
asp.netobjectdatasourcebusiness-logicdetailsview

Error when accessing BLL with ObjectDataSource : could not find a non-generic method


I'm a starting C# programmer and I'm experiencing the following problem. I've created a dataset in Visual Studio With a table for persons making use of two table adapters, one for selecting all persons and one for selecting one person at a time filtered by the personID (Guid). This is a seperate project of my solution.

After that I created a new project for the Business Logic Layer

private PersonenTableAdapter personenAdapter = null;
protected PersonenTableAdapter Adapter
{get....}

[System.ComponentModel.DataObjectMethodAttribute    (System.ComponentModel.DataObjectMethodType.Select, true)]
public DAL.Testdatabase.PersonenDataTable GetPersonen()
{...}

[System.ComponentModel.DataObjectMethodAttribute (System.ComponentModel.DataObjectMethodType.Select, false)]
public DAL.Testdatabase.PersonenDataTable GetPersonenByID(Guid ID)
{...}

[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
public bool updatePersoon(string Voornaam, string Achternaam, string Geslacht, string Adres, string Huisnr, string Postcode, string Plaats, string Telnr, string GSM, string BSN, DateTime? CreateDate, string CreatedBy, DateTime? LastModifiedDate, string LastModifiedBy, bool? Actief, DateTime? DatumInactief, Guid ID)
{...}

When issueing the Update method using a detailsview with an Objectdatasource i get the following error.

ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'updatePersoon' that has parameters: Voornaam, Achternaam, Geslacht, Adres, HuisNr, Postcode, Plaats, Telnr, GSM, BSN, CreateDate, CreatedBy, LastModifiedDate, LastModifiedBy, Actief, DatumInactief, original_ID.

Can someone please tel me what I'm doing wrong. Probably its a mistake that can't be difficult, but


Solution

  • ID != original_ID

    Look at the last parameter.