MySQL com EntityFramework
Olá,
Ao tentar criar um item Data no meu projeto Asp.net MVC 5 recebi o seguinte erro:
Unable to generate the model because of the following exception: 'System.Data.StrongTypingException: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.
E também
The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.
Depois de algumas tentativas e pesquisas descobri uma solução simples:
Abra o gerenciador de serviços (services.msc)
Reinicie o serviço MySQL57
Depois execute os seguintes comandos no MySQL:
use <seubancodedados>;
set global optimizer_switch='derived_merge=OFF';
Após isso tente novamente adicionar a base da dados que deve dar certo agora!
Boa sorte!
Ao tentar criar um item Data no meu projeto Asp.net MVC 5 recebi o seguinte erro:
Unable to generate the model because of the following exception: 'System.Data.StrongTypingException: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.
E também
The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull. ---> System.InvalidCastException: Specified cast is not valid.
Depois de algumas tentativas e pesquisas descobri uma solução simples:
Abra o gerenciador de serviços (services.msc)
Reinicie o serviço MySQL57
Depois execute os seguintes comandos no MySQL:
use <seubancodedados>;
set global optimizer_switch='derived_merge=OFF';
Após isso tente novamente adicionar a base da dados que deve dar certo agora!
Boa sorte!
Excelent
ResponderExcluir