блямба кавычки, теперь точно починил апдейт

This commit is contained in:
Timourka 2024-04-23 20:11:26 +04:00
parent ed872cb31c
commit 37bc219c04

View File

@ -218,7 +218,7 @@ namespace database
{
using var conn = GetConnection();
conn.Open();
using var cmd = new NpgsqlCommand("UPDATE rental SET car_id = @CarId, client_id = @ClientId, start_date = '@StartDate', end_date = '@EndDate', cost = @Cost WHERE id = @Id", conn);
using var cmd = new NpgsqlCommand("UPDATE rental SET car_id = @CarId, client_id = @ClientId, start_date = @StartDate, end_date = @EndDate, cost = @Cost WHERE id = @Id", conn);
cmd.Parameters.AddWithValue("@Id", rental.Id);
cmd.Parameters.AddWithValue("@CarId", rental.CarId);
cmd.Parameters.AddWithValue("@ClientId", rental.ClientId);