.net アプリケーションを mysql データベースに接続する必要があります。テーブルをモデルに追加すると、Tinyint 型のすべての列がブール値のようにマッピングされます。
mysqlフォーラムで検索した後、接続文字列に「Treat Tiny As Boolean = false」を追加します。モデルを更新しても何も変わりません。タイプを手動で Sbyte または Int 16 に変更すると、次のエラーが発生します。
Error 43 Error 2019: Member Mapping specified is not valid. The type 'Edm.SByte[Nullable=True,DefaultValue=]' of member 'personacion' in type 'Model.perfiles' is not compatible with 'MySql.usmallint[Nullable=True,DefaultValue=]' of member 'personacion' in type 'Model.Store.perfiles'. C:\Proyectos\StatusXMLGenerator\StatusXMLGenerator\StatusXMLGenerator\Model.edmx 474 17 StatusXMLGenerator
Error 42 Error 2019: Member Mapping specified is not valid. The type 'Edm.Int16[Nullable=False,DefaultValue=]' of member 'id_seccion' in type 'Model.formularios' is not compatible with 'MySql.bool[Nullable=False,DefaultValue=]' of member 'id_seccion' in type 'Model.Store.formularios'. C:\Proyectos\StatusXMLGenerator\StatusXMLGenerator\StatusXMLGenerator\Model.edmx 454 17 StatusXMLGenerator
エラー 42 のマッピングも正しくありません。列の型は Mysql.Bool と表示されていますが、データベースには 1 から 10 までの値が格納されているため、エラー 43 のように Mysql.usmallint である必要があります。
これは私の接続文字列です:
<add name="ModelContainer" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=MySql.Data.MySqlClient;provider connection string="server=**********;user id=*******;password=*****;database=pki_2010;persistsecurityinfo=True;Treat Tiny As Boolean=false;"" providerName="System.Data.EntityClient" />
何か案は?