I have got an UPDATE
query, what works well when I execute it in MS Managment Studio.
But if I try execute this query from my c# app, it executes without any exceptions, but does not update the table. Connection string is right.
This is the way I do it:
int contractId = 2
con.ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\tst.mdf;Integrated Security=True;Connect Timeout=30";
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "update аренды set datetime_возврата=GETDATE() where id_договора=@contractId";
cmd.Parameters.Add("@contract_id", SqlDbType.Int, 4).Value = contractId;
cmd.ExecuteNonQuery();
What can be wrong?