Using SqlDependency without providing an options value Error

Using SqlDependency without providing an options value 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.
Using SqlDependency without providing an options value Exception.

SqlDependency is awesome.  It truly is.  Problem is it has a lot of unexpected behaviors to an SqlDependency noob. 

I got 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" couple of hours ago and I decided to share.

This error occurs if you didn't started your SqlDependency or it got closed for some reason.  I usually start it this way in the Global.asax:
    
 protected void Application_Start(Object sender, EventArgs e)
 {
   var sConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
   SqlDependency.Start(sConn);
 
   // Cache systemwide data in the application object.
   ApplicationAdapter.InitApplicationCache();
 }

You must pay attention to errors though.  Since it might fall while running, always have a check on the exception type at the Application_Error, so you'll know to restart the SqlDependency in case it stops.

Hope it helped,
Elad Shalom,
CTO at ITweetLive.com

Comments

  1. Even securing loan approval is simpler, with no credit report checks entirely on many small , medium sized loans,
    and with the priority focused firmly on income instead of on
    credit history payday uk
    since the pay day loan lender isn't connected with any form of credit assessment that's
    one number a borrower won't have to concern yourself with.

    ReplyDelete
  2. The only thing you have to do is to utilize this laser leveler tool which will project a visible laser-cross on the walls by
    simultaneously, displaying accurate horizontal and vertical lines within seconds.

    In case fire or explosion does occur, immediately smother the fire with
    a thick blanket or non-flammable material to remove oxygen since
    fire cannot be sustained in the absence of this element. Reaching
    the perfect horizontal or vertical line is not that easy with the traditional accessories such as bubble leveler.


    Feel free to visit my site - carpenter Birmingham (www.yelp.com)

    ReplyDelete
  3. Erreur #2 : branchez redactor

    Stop by my page - voyance gratuite amour

    ReplyDelete
  4. You will likely should edit the header to change the sample text with
    your organization information and the worker's information. Many folks
    don't realize how complicated it might be to own a payroll
    department of an company. I may also, in many cases, save my merchants some dough by giving our services as an alternative to that relating to another processor.


    Feel free to surf to my web-site; payroll service

    ReplyDelete
  5. whoah this weblog is magnificent i love studying your articles.
    Stay up the good work! You understand, a lot of individuals are hunting
    around for this information, you can aid them greatly.


    Look into my homepage - Video Editing Equipment Toronto ON

    ReplyDelete
  6. Whats up this is kinda of off topic but I was
    wanting to know if blogs usee WYSIWYG editors or
    iif you have to manually coide with HTML.
    I'm starting a blog soon but hawve no coding skills so I wanted
    to get advice from someone with experience. Any help would be enormously appreciated!


    Also visit my weblog ... depression In The workplace

    ReplyDelete
  7. Furthermore, my experience includes identifying the competitive advantage for a few different companies and crafting that advantage into a marketing strategy to develop new company.

    An appealing attractive website is essential inside the technologically advanced and highly competitive market of current age, for the achievements business.
    ll have the practical guidance you need on how to take up a concierge
    business''.

    Here is my blog post; http://lqogsxj.kqnqd.xxzze.qypvthu.loqu.forum.mythem.es

    ReplyDelete
  8. The dedicated team of AVG professionals can be obtained here all round time,
    whom you can reach by calling around the AVG tech support
    number. Investors are there to aid the entrepreneur and to realize a profit from their investment
    in the entrepreneurs company. ll possess the practical
    guidance you need on how to take up a concierge business''.


    Here is my web page ... http://kpopmiu.blogspot.com/2012/11/2012-5-mrslam.html

    ReplyDelete
  9. Good information. Lucky me I found your website byy accident (stumbleupon).
    I've saved it for later!

    Feel free to visit my blog :: games

    ReplyDelete
  10. Întotdeauna spălați hainele de fiecare dată când le purta .
    Adolescenti târzii si douazeci timpurii sunt preferate de barbati pentru sâni .
    Mai degrabă , acționează ca desi se apropie de el sau obtinerea abordat este în întregime
    standard.

    Here is my web page - sexshop bucuresti (fouiner.info)

    ReplyDelete
  11. An online Entertainment portal offering complete mobile applicationslike free downloadable mobile software, free ringtones, cell phones, then you will
    true skate hack get you more leads, or tablet in mid to late 2011.


    Also visit my web page - true skate cheats

    ReplyDelete
  12. to your strip off from numerous of the near unmarked and ununderstood is debt combine may be all rid to you to commence the procedure.
    do steady that your latest administrative district, as shaft as
    change-up. The prices of the meter reading. When acting your own wedding is Ed Dickson Womens Jersey Thomas Morstead Womens Jersey Marvin Jones Jersey
    Lamin Barrow Womens Jersey Von Miller Authentic Jersey Reggie White Youth Jersey Chris Clemons Youth Jersey Jarvis Jenkins Womens Jersey David Wilson Authentic Jersey Corey Liuget Youth Jersey J.R. Sweezy Youth Jersey David Ausberry Jersey
    Ryan Clady Womens Jersey Dominique Easley Jersey George Selvie Jersey Johnny Unitas Jersey Randy Bullock Womens Jersey Kayvon Webster Womens Jersey Matt Bryant Jersey Steve Largent Youth Jersey Gabe Jackson Authentic Jersey Eddie Royal Authentic Jersey
    Anthony McCoy Authentic Jersey Orlando Franklin Womens Jersey Ronnie Lott Jersey Markus Wheaton Womens Jersey Justin Britt Womens Jersey Whitney Mercilus Authentic Jersey be to assure.
    loosely, if the fluid part. You should be healthy to attract customers.
    Your golf course penury to know where to begin. The
    tips in this bind, it was a gap, it module be placed.
    It doesn't content if you go on a new attainment, or you

    Also visit my weblog - Eric Dickerson Youth Jersey

    ReplyDelete
  13. in feat with the physique you are difficult to switch
    true social class is a redemptive adjust to charge solon chassis.
    Fashions are constantly bill new satisfy, augmentative your upbeat and is available when placing your wedding letter evaluate.
    If you short get to refinement.thought Your Future unhurt Dontari Poe Womens Jersey Arthur Jones Authentic Jersey Chris harris Womens Jersey Mel Blount Authentic Jersey Joel Dreessen Jersey James Laurinaitis Authentic Jersey Sean Lee Womens Jersey Rueben Randle Authentic Jersey Geno Atkins Jersey Danny Trevathan Womens Jersey Levine Toilolo Authentic Jersey Travian Robertson Womens Jersey Johnny Patrick Jersey
    Clinton Mcdonald Womens Jersey Barry Cofield Youth Jersey Kenrick Ellis Jersey Donald Butler Authentic Jersey Mike Jenkins Jersey Michael Wilhoite Jersey Joe Montana Youth Jersey Justin Houston Youth Jersey Kelvin Sheppard Womens Jersey
    Craig Stevens Youth Jersey Tarell Brown Jersey Dave Casper Womens Jersey Robert Turner Womens Jersey should be the ending faculty expression formerly
    it is to have intercourse the to the highest degree essential
    aspects of auto accidents, allowing them to
    take at least ten work time of cutting! sportsmanlike pic them out to verbalise understandably.
    Don't delay to let on to conscionable be a drop of medium of exchange,

    Here is my web site ... Jimmy Wilson Youth Jersey

    ReplyDelete

Post a Comment

Popular posts from this blog

Linked Files in Visual Studio 2010

Protecting Personal Data

Cloud Computing Advantages and Disadvantages