0

my win application have two SqlDependency against two tables on the same database, but only one of them work correctly(the last one). I guessed using SqlDependency.Start(connection, queue Name) and creating two separate queue solve this problem but it made this error :

"When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance. "

Masoumeh Karvar
  • 791
  • 1
  • 14
  • 32

1 Answers1

0

I find my mistake ,I worte :

SqlDependency.Stop(MYConnectionString); SqlDependency.Start(MYConnectionString)

before each 'MYSqlDependency.AddCommandDependency(MYCommand)'

then each sqldependency has closed when the next one was creating.

Masoumeh Karvar
  • 791
  • 1
  • 14
  • 32