Ask Your Question
3

What does the SqlException "Invalid column name 'TrackId'" mean when EF Core 6.0.13 generates TSQL queries with non-existent columns?

asked 2022-04-16 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-07 08:00:00 +0000

plato gravatar image

The SqlException "Invalid column name 'TrackId'" typically means that the TSQL query being executed by EF Core 6.0.13 contains a reference to a non-existent column named "TrackId". This could be caused by a variety of reasons, such as:

  1. A typo in the entity or property name in the DbContext or model configuration code.

  2. A mismatch between the names of columns in the database table and the property names in the entity classes.

  3. A failure to map the entity or property correctly in the DbContext or model configuration code.

To resolve this issue, you should carefully review your DbContext and model configuration code and ensure that all entity and property names, column names, and mappings are correct and consistent. You may also need to update your database schema to ensure that it matches the model configuration.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-16 11:00:00 +0000

Seen: 13 times

Last updated: Aug 07 '22