arkadaşlar aişağıdaki kod bloğunda syntax hatası alıyorum. bir türlü sebebini bulamadım. breakpoint le bakıyorum execute satırına kadar tüm veriler düzgün bir şekilde geliyor ama execute yaparken syntax hatası veriyor.
Hata Kodu: _System.FormatException: 'Giriş dizesi doğru biçimde değildi.'_
public void Update(Product product)
{
if (_connection.State == ConnectionState.Closed)
{
_connection.Open();
}
SqlCommand commandd = new SqlCommand("Update Products set Name=@name, UnitPrice=@unitPrice, StockAmount=@stockAmount where Id=@id)", _connection);
commandd.Parameters.AddWithValue("@id", product.Id);
commandd.Parameters.AddWithValue("@name", product.Name);
commandd.Parameters.AddWithValue("@unitPrice", product.UnitPrice);
commandd.Parameters.AddWithValue("@stockAmount", product.StockAmount);
commandd.ExecuteNonQuery();
_connection.Close();
}