title: Cannot insert data into mbf database
body: <p>I have been trying to insert data into a sql database for the last hours. for one or other reason I am able to connect to the database, but no data is inserted into the database. if I run the sql statement directly in the database it does seem to work. So therefore, I was able to conclude that the statement is correct. Furthermore, there were no errors in runtime. I have got the following c# code:</p>
  
  <pre><code>//Neither of these statements seem to work.
  string sqlStatement = "INSERT INTO dbo.eventTable (colA, colB, colC, colD, colE, colF, colG, colH, colI) VALUES (@a,@b,@c,@d,@e,@f,@g,@h,@i)";
  string altSqlStatement = "INSERT INTO dbo.eventTable (colA, colB, colC, colD, colE, colF, colG, colH, colI) VALUES (@a,@b,@c,@d,@e,@f,@g,@h,@i)";
  
      foreach (DataRow row in importData.Rows)
      {
          using (SqlConnection conn = new SqlConnection(form1.Properties.Settings.Default.showConnectionString))
          {
              using (SqlCommand insertCommand = new SqlCommand())
              {
                  insertCommand.Connection = conn;
                  insertCommand.CommandText = sqlStatement;
                  insertCommand.CommandType = CommandType.Text;
  
                  insertCommand.Parameters.AddWithValue("@a", row["CUE"].ToString());
                  insertCommand.Parameters.AddWithValue("@b", row["HH"].ToString());
                  insertCommand.Parameters.AddWithValue("@c", row["MM"].ToString());
                  insertCommand.Parameters.AddWithValue("@d", row["SS"].ToString());
                  insertCommand.Parameters.AddWithValue("@e", row["FF"].ToString());
                  insertCommand.Parameters.AddWithValue("@f", row["ADDR"].ToString());
                  insertCommand.Parameters.AddWithValue("@g", row["Event Description"].ToString());
                  insertCommand.Parameters.AddWithValue("@h", row["CAL"].ToString());
                  insertCommand.Parameters.AddWithValue("@i", row["PFT"].ToString());
  
                  try
                  {
                      conn.Open();
                      int _affected = insertCommand.ExecuteNonQuery();
                  }
                  catch(SqlException e)
                  {
                      // do something with the exception
  
                  }
              }
          }
     }
  </code></pre>
  
  <p>if I change the connection parameters to something false, an error occurs, so that seems correct. </p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Thanks! </p>
  
  <p>Alex </p>