I absolutely do not get this. The column exists in the table, I've ensured that the application is executing the query against the proper table in the proper database, and it still reports that it's an invalid column name.
I'm running NET 4.0, SQL Server 2008 Express Edition. Does anyone have any similar experience?
Executing queries against any other column name in the same table in the same database works extremely excellently. I added this column today and for some reason my application refuses to acknowledge the existence of this column.
Relevant column definition:
Relevant code:
(from x in flightDataContext.FlightDatas
where x.FlightDataId == FlightDataID && x.Departure == true
select new
{
x.ArrivalStationCode,
x.ArrivalStationName,
x.DepartureTime,
x.DepartureGate
}).SingleOrDefault();
I also faced the same problem.You can try the following solutions.
You should update your classes after the database changed(drag and drop your tables to the linq to sql file), so that the column is accessible with object name. if still problem exists then the value you are saving in the coloumn is greater then the size specified for the coloumn. try varchar(MAX) if your coloumn is of varchar type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With