I have one table Car(CarID(int) , NameCar(varchar(50), Mileage(varchar(50), Manufacture(varchar(50), Price(varchar(50)).
I want to show price of Car in the label tab when select the car from dropdownlist.
I use this code:
In DBBL.cs Class: public List<Car> GetAllCars() { return context.Car.ToList(); } public Car rate(int id) { return context.Car.Where(x=>x.CarID==id).Select(x=>x.Price).SingleOrDefault(); } //Prints the error: "Cannot implicitly convert type 'string' to 'CarRent.Data.EF.DAL.Cars "
What should be done to resolve this?
Thanks in advance