-1

System.Data.Entity.Core.MetadataException: 'Unable to load the specified metadata resource.'

Code:

IPagedList<Tbl_Product> data = context.Database
                                      .SqlQuery<Tbl_Product>("GetBySearch @search", param)
                                      .ToList()
                                      .ToPagedList(page ?? 1, pageSize);
return new HomeIndexViewModel
1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Mar 5, 2022 at 13:18

2 Answers 2

0

Try - Right click on the project>>Clean>> and then Rebuild - This resolved the error for me.

Also, this question is similar to: System.Data.MetadataException: Unable to load the specified metadata resource

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks mate it worked but now giving following exception Could not find stored procedure 'GetBySearch'.
0

The error comes from SQL Server. It means that the server failed to find the procedure with name 'GetBySearch'

There might be several reasons for that:

  • typo in code or on the server - double-check that the name on the server matches exactly the name you call

  • double-check that the data source is set to the right server

  • double-check that the database name is specified, aka either it is set in the connection string or it is set by calling ChangeDatabase method on SqlConnection. Refer to MSDN for more details...

Let me know if you have more questions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.