command parameters
Posted: Tue 04 Aug 2015 15:58
I'm trying to change the password of a login role ('test'):
But this fails with: syntax error at or near \"$1\"
I tried hardcoding the password (i.e. i.e. alter role @user test with 'test') and this fails too. It works fully hardcoded (i.e. alter role test with 'test').
c#, VS2013, latest dotConnect
Code: Select all
using (var command = new PgSqlCommand("alter role @user test with password @pw", MyConnection))
{
command.Parameters.AddWithValue("@user", user);
command.Parameters.AddWithValue("@pw", pw);
result = (command.ExecuteNonQuery() == -1);
}
I tried hardcoding the password (i.e. i.e. alter role @user test with 'test') and this fails too. It works fully hardcoded (i.e. alter role test with 'test').
c#, VS2013, latest dotConnect