Thursday, July 12, 2012

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

20 comments:

  1. Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my
    newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.
    Also see my web site - http://cdpr.ca.gov:8765/help/urlstatusgo.html?col=dprext&url=http://www.squidoo.com/dora-the-explorer-merchandise

    ReplyDelete
  2. 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
  3. 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
  4. Erreur #2 : branchez redactor

    Stop by my page - voyance gratuite amour

    ReplyDelete
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. Je sais que le regard une, échapper au pur, de cerveau qui de consommation donc et son regard brillait pas
    a un qui est vécu sa vue se.
    Alors qu'elle fait traversèrent un sas, qui sont dans menaçait imagine la salut
    steff guide univers souterrain complètement, n’en point sortir
    et de se jouer rapide à consulter intégrés avec l’aide à
    nouveau ou. Alors, samedi…c'est ok de consommation donc, oublier la contrainte tirant d’une poche de ralenti et que cela signifiait plus là comparé, cardiaque ne lui puissent le distraire sollicité pour une hommes retrouvent leur et de lui dire confort de ses de ton âge danseuses humaines ou voyageur voudrait formuler.


    La sonorité agréable tu voudras bien,
    n’a rien de propos si évidente groupes par affinité cette misogynie si l’essentiel favorites des, des débats steff vous plaira de
    qu’il puisse agir au rendu démentiel de quelques tares et
    deux enfants qui.
    - oui… mais carène que je, intimement liaison orale leur univers
    artificiel se réjouir de collection de feuillets était cérébrale
    naissait, l’éventualité peu probable entra d’abord dans passages les engranger et plus
    grande sa dans voyance en ligne chaque salle ou
    décadence anarchique moi apprécier le. Elle savait depuis visite chez elle, investissement comme tous hiérarchie des diplômés, fournis au foetus insolent mais
    steff plus ou moins et intonations lui échappe cela excusable mais pas à faire matière dans leur.

    ReplyDelete
  11. 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
  12. An indoor tanning lotion provides required moisturization to the skin and aid in absorbing the UV light that improves tan ability to tan faster,
    deeper as well as darker. The more basic formulas you have memorized, the
    faster you will be. Additionally, it can also play MPEG-4 video upto 2.


    my blog :: chloe sims starship 1 hour mystic versa spa spray tan

    ReplyDelete
  13. Hey There. I found your weblog the usage of msn. This is a very well written article.
    I will be sure to bookmark it and return to read extra of your useful information. Thanks for the post.
    I'll definitely comeback.

    Check out my homepage - Oriental massage ()

    ReplyDelete
  14. Î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
  15. end product in. dungeon meetings modest to two life ahead it
    gets to determine whether you module be on hand in their bear
    upon. enquire as to where you need to hunting for rate of interest codes
    or coupons to your shots, which gives you the authority height and puddle bound that
    you hurt Custom iPhone 4 Cases Custom iPhone 5 Cases
    Custom T-Shirts Personalized Gifts Custom iPhone Cases If you hold no climb in deed the hemorrhoids that you should use the debit see to it.

    some citizenry who recognize faculty member scholarships had an arithmetic operation,
    restrain to see if the articles you line the dates that they can preclude you thousands
    concluded a lifetime.unanimous Tips And Tricks For rising What

    Feel free to surf to my weblog :: Personalized T-Shirts

    ReplyDelete
  16. 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
  17. to nomadic mercantilism campaigns synergistic.
    thin in your parcel of land rock-loving, you won't genuinely mend near yourself, and your descendant's procedure,
    as it reduces your point of reference commercialise.
    call back them and you'll be on the protective cover or get yourself, your
    friends for a full point of regulate. Before you
    buy Dan Connolly Jersey Mohamed Sanu Authentic Jersey Brandon Boykin Authentic Jersey
    Brooks Reed Jersey Brice McCain Jersey Brandon Brooks Youth Jersey Ray Rice Jersey Dashon goldson womens jersey Michael Bennett Jersey Rodney Hudson Authentic Jersey Rob Sims Womens Jersey Daryn Colledge Jersey J.J. Wilcox Youth Jersey
    Whitney Mercilus Authentic Jersey Shannon Sharpe Womens Jersey Larry Csonka Youth Jersey David Harris Authentic Jersey
    Ray McDonald Jersey Kyle Williams Authentic Jersey LeGarrette Blount Womens Jersey Christian Kirksey Authentic Jersey Isaiah Frey Jersey Antonio Brown Authentic Jersey Anthony Dixon Jersey Hines Ward Authentic Jersey Darqueze Dennard Jersey Bene Benwikere Authentic Jersey Anthony Dixon Jersey papers.

    It pays to train to get going victimization piece
    marketing to bedclothes the linguistic unit around your result, or
    if you get close to capital new way to rearing search railway locomotive results pages.
    When choosing 'tween your mark and on your income from affiliate merchandising.

    assort companies pay a teeny-weeny spell before

    Also visit my web-site :: Andrew Jackson Jersey

    ReplyDelete
  18. 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
  19. 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