keyword not supported data source

后端 未结 6 536
灰色年华
灰色年华 2020-11-28 23:39

I have an asp.net-mvc application with the default membership database. I am accessing it by ADO.NET Entity Framework.

Now I want to move it to IIS, but several pro

6条回答
  •  旧巷少年郎
    2020-11-29 00:12

    I know this is an old post but I got the same error recently so for what it's worth, here's another solution:

    This is usually a connection string error, please check the format of your connection string, you can look up 'entity framework connectionstring' or follow the suggestions above.

    However, in my case my connection string was fine and the error was caused by something completely different so I hope this helps someone:

    1. First I had an EDMX error: there was a new database table in the EDMX and the table did not exist in my database (funny thing is the error the error was not very obvious because it was not shown in my EDMX or output window, instead it was tucked away in visual studio in the 'Error List' window under the 'Warnings'). I resolved this error by adding the missing table to my database. But, I was actually busy trying to add a stored procedure and still getting the 'datasource' error so see below how i resolved it:

    2. Stored procedure error: I was trying to add a stored procedure and everytime I added it via the EDMX design window I got a 'datasource' error. The solution was to add the stored procedure as blank (I kept the stored proc name and declaration but deleted the contents of the stored proc and replaced it with 'select 1' and retried adding it to the EDMX). It worked! Presumably EF didn't like something inside my stored proc. Once I'd added the proc to EF I was then able to update the contents of the proc on my database to what I wanted it to be and it works, 'datasource' error resolved.

    weirdness

提交回复
热议问题