skip to Main Content

C# .net and Mysql insert statement fails during command execution

I am trying to insert into the mysql database the following record in a Create() method in a Repository class: MySqlCommand command = new MySqlCommand("INSERT INTO `documentdetails` (?dtoDocumentId);", _connection); command.Connection = _connection; command.CommandType = CommandType.Text; command.Parameters.Add("?dtoDocumentId", MySqlDbType.Int64).Value=documentDetail.DocumentId; command.ExecuteNonQuery(); The documentId…

VIEW QUESTION

MySqlDataReader : I close the connection but get : There is already an open DataReader associated with this Connection which must be closed first

private void startPoll() { System.Diagnostics.Debug.WriteLine("dbForm created"); timer = new Timer(int.Parse(Properties.Settings.Default.DbPoll) * 1000); // ElapsedEventHandler OnEventExecution = null; timer.Elapsed += OnEventExecution; timer.Start(); System.Diagnostics.Debug.WriteLine("Timer Started " + Properties.Settings.Default.DbPoll + " secs"); string connectionString; // MySqlConnection conn; connectionString = "server=" + Properties.Settings.Default.DbServer +…

VIEW QUESTION
Back To Top
Search