There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Hi,
I have a large native query that returns many bigint(x) columns on a MySQL 5.7 db.
I run it with context.Database.SqlQuery<MyCustomClass>(query).ToList();
Accoring to this link https://www.devart.com/dotconnect/mysql ... pping.html, the only type that gets concerted to SByte is tinyint, but when I run the query in dbForge Studio, I do not get any rows as tinyint. I get int, uint, bigint(1 to 11).
Why am I getting this werror and how can I debug this? The only error I get is this, but I have a large query with ~70 columns so how can I figure out which column is the offender?
System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
at System.Data.Entity.ModelConfiguration.Edm.Services.StructuralTypeMappingGenerator.MapTableColumn(EdmProperty property, String columnName, Boolean isInstancePropertyOnDerivedType)
at System.Data.Entity.ModelConfiguration.Edm.Services.PropertyMappingGenerator.Generate(EntityType entityType, IEnumerable`1 properties, EntitySetMapping entitySetMapping, MappingFragment entityTypeMappingFragment, IList`1 propertyPath, Boolean createNewColumn)
at System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType entityType, DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator()
at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
I have a large native query that returns many bigint(x) columns on a MySQL 5.7 db.
I run it with context.Database.SqlQuery<MyCustomClass>(query).ToList();
Accoring to this link https://www.devart.com/dotconnect/mysql ... pping.html, the only type that gets concerted to SByte is tinyint, but when I run the query in dbForge Studio, I do not get any rows as tinyint. I get int, uint, bigint(1 to 11).
Why am I getting this werror and how can I debug this? The only error I get is this, but I have a large query with ~70 columns so how can I figure out which column is the offender?
System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
at System.Data.Entity.ModelConfiguration.Edm.Services.StructuralTypeMappingGenerator.MapTableColumn(EdmProperty property, String columnName, Boolean isInstancePropertyOnDerivedType)
at System.Data.Entity.ModelConfiguration.Edm.Services.PropertyMappingGenerator.Generate(EntityType entityType, IEnumerable`1 properties, EntitySetMapping entitySetMapping, MappingFragment entityTypeMappingFragment, IList`1 propertyPath, Boolean createNewColumn)
at System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType entityType, DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator()
at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
This results in the same error, so it's not the query:
context.Database.SqlQuery<MyCustomClass>("SELECT firstname FROM people LIMIT 1").ToList()
class MyCustomClass
{
public string FirstName { get; set; }
}
Could it be it the model itself? One of the 30 tables has many tinyint fields which got mapped to sbyte by EntityDeveloper. But it can't be that: many classes have SByte properties, and I've been using that model for years with Devart.
I have no clue where to go from here.
context.Database.SqlQuery<MyCustomClass>("SELECT firstname FROM people LIMIT 1").ToList()
class MyCustomClass
{
public string FirstName { get; set; }
}
Could it be it the model itself? One of the 30 tables has many tinyint fields which got mapped to sbyte by EntityDeveloper. But it can't be that: many classes have SByte properties, and I've been using that model for years with Devart.
I have no clue where to go from here.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Try opening your *.edml model with XML Editor and look for SByte entries.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
There are 132 of them, in many classes (there are 92 EntityTypes) I've been using without errors for years. I recently added a few more classes (with yet more SBytes) for this project and now the model dies. What should I do?
I cannot modify the tables for legacy reasons.
I cannot modify the tables for legacy reasons.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
That is a stack trace of a different provider that talks to SQL Server instead of MySQL.
Please send us a small test project with the corresponding DDL/DML script so that we can reproduce the error in our environment.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Is anyone working on this? Did you receive my repro solution?
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
I think it's a bug in Context.Database.Initialize() because the error source is "EntityFramework.SqlServer" but I do not use sqlserver anywhere. It's not even installed. I only use mysql.
Model edml file starts with:
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="Database.C2.Entities.Store" Alias="Self" Provider="Devart.Data.MySql" ProviderManifestToken="MySQL, 5.7.20" xmlns:store="http://schemas.microsoft.com/ado/2007/1 ... aGenerator" xmlns:devart="http://devart.com/schemas/edml/StorageS ... nsions/1.0" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
Meanwhile, if there is an alternate way to send manual queries through your library please let me know.
Model edml file starts with:
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="Database.C2.Entities.Store" Alias="Self" Provider="Devart.Data.MySql" ProviderManifestToken="MySQL, 5.7.20" xmlns:store="http://schemas.microsoft.com/ado/2007/1 ... aGenerator" xmlns:devart="http://devart.com/schemas/edml/StorageS ... nsions/1.0" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
Meanwhile, if there is an alternate way to send manual queries through your library please let me know.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Thank you for the test project. We have reproduced the issue and are investigating it. We will notify you about the result.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
The current implementation of dotConnect for MySQL includes two sets of assemblies with the same names and versions:
1) the .NET Framework Devart.* assemblies which are shipped with installation:
* assemblies are created in C:\Program Files (x86)\Devart\dotConnect\MySQL\ , GAC 2.0 (C:\Windows\assembly\GAC_MSIL\), GAC 4.0 (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\)
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... nsing.html
2) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:
* you can download packages from https://www.nuget.org/packages/devart.data.mysql.ef6
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... ndard.html
Are you going to work with .NET Framework or .NET Core application?
* With .NET Framework, the EF6 provider registration should be placed in *.config file of startup application (not DAL assembly).
* With .NET Core, the EF6 provider registration is different: https://www.devart.com/dotconnect/mysql ... ovideref63.
Refer to https://blog.devart.com/entity-framewor ... pport.html.
1) the .NET Framework Devart.* assemblies which are shipped with installation:
* assemblies are created in C:\Program Files (x86)\Devart\dotConnect\MySQL\ , GAC 2.0 (C:\Windows\assembly\GAC_MSIL\), GAC 4.0 (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\)
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... nsing.html
2) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:
* you can download packages from https://www.nuget.org/packages/devart.data.mysql.ef6
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... ndard.html
You mixed up .NET Framework and .NET Standard Devart.* assemblies in your solution. You should use only one set of them (do not mix).There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
Are you going to work with .NET Framework or .NET Core application?
* With .NET Framework, the EF6 provider registration should be placed in *.config file of startup application (not DAL assembly).
* With .NET Core, the EF6 provider registration is different: https://www.devart.com/dotconnect/mysql ... ovideref63.
Refer to https://blog.devart.com/entity-framewor ... pport.html.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Hi,
In production, I only use Framework 4.8 and I never use the GAC. I recreated a repro with .net 4.8. Same result.
I have been using the same solution for many years (14 or so). This error just started appearing 2 weeks ago. I need a resolution asap.
I am unable to send you the repro by email because gmail, in its infinite wisdom, does not allow zip attachments. Please provide a way for me to upload it to you. (but not here on a public forum)
In production, I only use Framework 4.8 and I never use the GAC. I recreated a repro with .net 4.8. Same result.
I have been using the same solution for many years (14 or so). This error just started appearing 2 weeks ago. I need a resolution asap.
I am unable to send you the repro by email because gmail, in its infinite wisdom, does not allow zip attachments. Please provide a way for me to upload it to you. (but not here on a public forum)
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Guys,
This is terrible service.
This is terrible service.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
We didn't receive your updated test project. Please upload it to some file exchange server (e.g.: www.dropbox.com) and send us the download link via our contact form.
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
Another week without a response. This is atypical from Devart. I've been a client for years but this worries me about your company.
I still get errors refering to SqlServer but there is nothing referring to SqlServer anywhere: I strictly use MySQL. Iadded a defaultConnectionFactory to make sure EF6 doesn't try to load SqlServer by default but it didn't help.
"An unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll
The store type 'enum' could not be found in the SqlServer provider manifest"
Here you can replace 'enum' with many other types not supported by SqlServer. Why is the library loading SqlServer? There is not a single reference to "SqlServer" in the entire code base.
using (Database.Entities.Context context = new Database.Entities.Context("mydb"))
{
context.Database.Initialize(true); --> Exception
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<connectionStrings>
<add name="mydb" connectionString="server=localhost;user id=me;password=pw;database=mytable;charset=utf8;unicode=True;FoundRows=true;" providerName="Devart.Data.MySql" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.MySql" />
<add name="dotConnect for MySQL" invariant="Devart.Data.MySql" description="Devart dotConnect for MySQL" type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="Devart.Data.MySql.Entity.MySqlConnectionFactory, Devart.Data.MySql.Entity.EF6" />
<providers>
<provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity.EF6" />
</providers>
</entityFramework>
</configuration>
I still get errors refering to SqlServer but there is nothing referring to SqlServer anywhere: I strictly use MySQL. Iadded a defaultConnectionFactory to make sure EF6 doesn't try to load SqlServer by default but it didn't help.
"An unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll
The store type 'enum' could not be found in the SqlServer provider manifest"
Here you can replace 'enum' with many other types not supported by SqlServer. Why is the library loading SqlServer? There is not a single reference to "SqlServer" in the entire code base.
using (Database.Entities.Context context = new Database.Entities.Context("mydb"))
{
context.Database.Initialize(true); --> Exception
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<connectionStrings>
<add name="mydb" connectionString="server=localhost;user id=me;password=pw;database=mytable;charset=utf8;unicode=True;FoundRows=true;" providerName="Devart.Data.MySql" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.MySql" />
<add name="dotConnect for MySQL" invariant="Devart.Data.MySql" description="Devart dotConnect for MySQL" type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="Devart.Data.MySql.Entity.MySqlConnectionFactory, Devart.Data.MySql.Entity.EF6" />
<providers>
<provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity.EF6" />
</providers>
</entityFramework>
</configuration>
Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'
SqlServer is included in the EntityFramework NuGet package and is used by the EF engine as a default provider.francis wrote: ↑Fri 09 Oct 2020 17:58 "An unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll
The store type 'enum' could not be found in the SqlServer provider manifest"
Here you can replace 'enum' with many other types not supported by SqlServer. Why is the library loading SqlServer? There is not a single reference to "SqlServer" in the entire code base.
Please upload your updated solution, that uses only .NET Framework Devart.* assemblies shipped with the provider installation, to some file exchange server (e.g.: www.dropbox.com) and send us the download link via our contact form.