Database permissions

Feb 4, 2016 at 10:08 PM
Hello and thank you for this awesome piece of code. I am having trouble getting it to work, however.

I followed your instructions and used the WPF example code in a MSSQL server 2014 Express, but am getting the following error when starting the dependency:
"An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code. Additional information: Cannot find the procedure 'Stocks_449e0e4d-aaa6-4cc5-bcbe-7a74f289ff2b_QueueActivation', because it does not exist or you do not have permission."

The user I'm using in my connection string has the following permissions:
  • CONNECT
  • CREATE CONTRACT
  • CREATE MESSAGE TYPE
  • CREATE PROCEDURE
  • CREATE QUEUEU
  • CREATE SERVICE
  • SELECT
  • UPDATE
  • VIEW DEFINITIONS
    (It doesn't give the option for CREATE TRIGGER and RECEIVE per your notes)
The user also has the following permission on the [dbo] schema:
  • ALTER
  • CREATE SEQUENCE
  • SELECT
  • UPDATE
  • VIEW DEFINITION
What am I missing? Since nobody else has brought this up as a discussion and/or issue, I'm sure it is something simple.

I appreciate your help!
Feb 5, 2016 at 3:59 AM
Edited Feb 5, 2016 at 4:08 AM
I was able to overcome this issue by adding the sql user I'm connecting with to the db_owner database role.

Issue seems to be I created the database with a windows account and subsequently used a sql user account to connect with via the WPF app.

Hope this helps someone else.