public bool UpdatePassword(Guid id, string password)
{
var queryString =
"UPDATE [dbo].[accounts] " +
"SET password = @password " +
"WHERE [dbo].accounts.accountid = @accountid";
using (SqlConnection connection = new SqlConnection(_connectionString))
{
var command = new SqlCommand(queryString, connection);
command.Parameters.AddWithValue("password", password);
command.Parameters.AddWithValue("accountid", id);
try
{
connection.Open();
command.ExecuteNonQuery();
}
catch (Exception)
{
throw;
}
return true;
}
}