私のデータベースには、次の例のように、挿入を実行しようとしています:http://insidemysql.com/howto-starting-with-mysql-ef-core-provider-and-connectornet-7-0-4/。エンティティフレームワークとMariaDB - phpMyAdmin
public class Sistema
{
public int Id { get; set; }
public List<Agenda> Agendas { get; set; }
}
とエラー:
var entry = new Sistema();
using (var context = SistemaFactory.Create(connectionString))
{
context.Sistemas.Add(entry);
context.SaveChanges();
}
は、これは私のモデルである:私は、しかし、何らかの理由で私は以下INSERTに同じエラーを得続ける、データベースとテーブルの作成に成功しています私は、PostgreSQLの代わりに、MySQLを使用していますので、私はこのエラーを修正することはできません今のところ
{Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DEFAULT VALUES;
SELECT `Id`
FROM `Sistemas`
WHERE ROW_COUNT() = 1
AND `Id`=' at line 2
を:私は取得しておくこと。
エラーが発生したSQLを表示します。 –
@RickJames私はそれが可能かどうかわかりませんが、私が得ることができる唯一のSQLはすでに質問に載っています。 –
"行1"が必要です。 (場合によってはサードパーティのソフトウェアが途中で取得されることがあります) –