Entity Framework Error: Cannot implicitly convert type DAL.OtherIncome to AccountSystem.OtherIncome in ASP.Net

Last Reply 3 months ago By Vadivxaya

Posted 3 months ago

I am Getting a error 

Cannot implicitly convert type 'DAL.OtherIncome' to 'AccountSystem.OtherIncome'

Can You Please help me to fix this

IncomeDAL.cs

public OtherIncome getByID(int id)
{
    OtherIncome OtherInc = ent.OtherIncomes.Where(o => o.ID==id).Single();
    return OtherInc;
}

int OtherID = int.Parse(ViewState["ID"].ToString());
IncomeDAL Inc = new IncomeDAL();
OtherIncome othIn = Inc.getByID(OtherID);
You are viewing reply posted by: Vadivxaya 3 months ago.
Posted 3 months ago

Dear Dharmendr,

 

Thanks for your reply, i found the reason for error happen.

Because i am using the same name in database table and page name, now i change the table name its working. thank you for your replay once again.

Thanks,

Vadivxaya 

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html