Hello.
Often, the error appears. A very long time I am trying to identify it.
And now, finally, I found what was going on.
For some reason, when using the connection between the three tables, there is a problem - "Unable to cast SQLiteProviderType to MySqlProviderType.".
For clarity, I gave a simple example.
In the archive, the source code and a video demonstration.
Perhaps something with a cache of ORM.
Example-2016.04.12.rar (7.0 МБ) - (WinRar 5.x archive type)
MD5:6d7aeed56c705fafb0d053c0daa7377a
SHA:197f7d5414391e0504320444c9c61d9e9eb915c1c
http://rghost.ru/6DN72xlS2
http://nashdisk.ru/cbc2ac/
PS: Here's another related topic - http://forums.devart.com/viewtopic.php?f=31&t=24588System.InvalidCastException перехвачено
_HResult=-2147467262
_message=Не удалось привести тип объекта "Devart.Data.SQLite.Linq.Provider.SQLiteProviderType" к типу "Devart.Data.MySql.Linq.Provider.MySqlProviderType".
HResult=-2147467262
IsTransient=false
Message=Не удалось привести тип объекта "Devart.Data.SQLite.Linq.Provider.SQLiteProviderType" к типу "Devart.Data.MySql.Linq.Provider.MySqlProviderType".
Source=Devart.Data.MySql.Linq
StackTrace:
в Devart.Data.MySql.Linq.Provider.MySqlDataProvider.ProcessParameterValue(DbParameter parameter, Type clrType, ProviderType providerType, Object value)
в Devart.Data.Linq.DataProvider.ApplyParameter(DbParameter parameter, String name, ParameterDirection direction, ProviderType providerType, Type clrType, Object parameterValue)
в Devart.Data.Linq.DataProvider.a(c1 A_0, Object[] A_1)
в Devart.Data.Linq.DataProvider.b(c1 A_0, Object[] A_1)
в Devart.Data.Linq.Engine.a3.a(IProvider A_0, Object[] A_1)
в Devart.Data.Linq.Engine.bc.a(IProvider A_0, Object[] A_1)
в Devart.Data.Linq.Engine.DeferredEnumerable`1.GetEnumerator()
в System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
в Devart.Data.Linq.EntityRef`1.get_Entity()
в ceContext.Company.get_ComType() в d:\Repository\temp\WindowsFormsApplication8-2016.04.12\ORM Datasource\ceDataContext.Designer.cs:строка 297
в ORM_Datasource.FormMain.GetControlObjects(ceDataContext dcContext) в d:\Repository\temp\WindowsFormsApplication8-2016.04.12\ORM Datasource\FormMain.cs:строка 81
InnerException: