Мне нужна помощь, чтобы преобразовать код firebird в mysql C# visual studio app
вот код жар-птицы
public bool InsertNewCarsFees(structNewCarFees ncf) { fbConnection.Open(); FbCommand fbCommand = ncf.CreateInsertCommand(); fbCommand.Connection = fbConnection; try { fbCommand.ExecuteNonQuery(); NewCarFees.Add(ncf); fbCommand.Dispose(); fbCommand = null; fbConnection.Close(); return true; } catch { fbCommand.Dispose(); fbConnection.Close(); return false; } }
Что я уже пробовал:
Я новичок в C# и MySql - все еще учусь
public bool InsertNewCarsFees(StructNewCarFees ncf) { qmConnection.Open(); MySqlCommand cmd = ncf.CreateInsertCommand(); cmd.Connection = qmConnection; try { cmd.ExecuteNonQuery(); newCarFees.Add(ncf); cmd.Dispose(); cmd = null; qmConnection.Close(); return true; } catch { cmd.Dispose(); qmConnection.Close(); return false; } }
Это сообщение об ошибке, относящееся к КФН.CreateInsertCommand
Severity Code Description Project File Line Suppression State Error CS7036 There is no argument given that corresponds to the required formal parameter 'qmConnection' of 'StructNewCarFees.CreateInsertCommand(MySqlConnection)' QMData C:\Users\quote\Documents\QM Online App\QMData\ClassQM.cs 125 Active