Using Scope_IDENTITY() you can get that value.
For that you have to change your query to
"insert into UserInfo(x,x,x,x) values(x,x,x,x);SELECT SCOPE_IDENTITY();"
After that you have to change command execution from ExecuteNonQuery() to ExecuteScalar()
Object id = GetSqlCommand(connection, sql, parameters).ExecuteScalar();
Now you got the last primary key inserted by above command.