No exceptions, everything gets executed but the update doesn't happen!
Everything works ok when I have just @JIR parameter but now I added @Paragon and the update doesn't do it's job. No exception whatsoever data passed is OK...
I don't see anything wrong with this query does anyone know what could possibly be going wrong?
private static void InsertJIR(FisDnevni racun)
{
using (OleDbConnection con = new OleDbConnection(RegistarBlagajna.Modul.VezaNaBazu.ConnectionString))
{
try
{
con.Open();
OleDbCommand cmd = new OleDbCommand(@"
UPDATE FisDnevni
SET [JIR] = @JIR,
[Paragon] = @Paragon
WHERE BrojRacuna = @BrojRacuna"
, con);
cmd.Parameters.AddWithValue("@JIR", racun.JIR.Substring(0,37));
cmd.Parameters.AddWithValue("@BrojRacuna", racun.BrojRacuna);
cmd.Parameters.AddWithValue("@Paragon", racun.Paragon);
cmd.ExecuteNonQuery();
con.Close();
}
catch (Exception)
{
throw;
}
}
}
Addinstead ofAddWithValue. Also, try to add the parameters in the same order as they appear in the query. (this shouldn't matter but can't hurt). Also,OleDbCommandis also anIDisposable, you should use it inside ausingstatement. One last thing - why are you using try...catch when all you do in your catch isthrow?@Paragonin second order instead.