Using the Microsoft Data Access Application Block

Application Blocks are a collection of libraries from Microsoft. Among the list of components will be the Data Access Application Block. This component can help to save considerable time by allowing you to specify several parameters and definitely will meet most if not all of your data access logic needs.

The download is here – http://www.microsoft.com/en-gb/download/details.aspx?id=435. Simply add the DLL to the BIN folder of your application or website. 

The main class for data access is the SqlHelper class. The SqlHelper class simplifies the job of writing data access

ExecuteDataset

A data table can be created with a single line of code. Here’s an example.

Dim dt as System.Data.DataTable = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(Conn, System.Data.CommandType.Text, “select * from Products”).Tables(0)

Where Conn is the connection string to the database. Stored procedures can also be called by using CommandType.StoredProcedure. Parameters can be added an array of SqlParameter objects

Dim dt as System.Data.DataTable = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(Conn(), System.Data.CommandType.Text, “select * from Products where Field1=@Field1”, New System.Data.SqlClient.SqlParameter("@Field1", Field1)).Tables(0)

Methods are also available for DataReaders, XmlReaders, scalar values and non-queries. Here are some examples.

Dim dr As System.Data.SqlClient.SqlDataReader = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(Conn, CommandType.Text, "select * from Products")
Dim x As Integer = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(Conn, CommandType.Text, "select top 1 ProductID from Products")
SqlHelper.ExecuteNonQuery(Conn, CommandType.Text, "select from Products where ID=1")
Updated: March 6, 2015 — 4:56 pm

Comments

Add a Comment
  1. Your comment is awaiting moderation.

    You actually reported that perfectly!

    viagra effects after ejaculation viagra viagra find ago edinburgh hours
    buy generic viagra
    buy hebal viagra – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  2. Your comment is awaiting moderation.

    Many thanks! Lots of knowledge.

    experation date viagra viagra relaxes sphincter
    viagra 100mg
    aspirin viagra – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  3. Your comment is awaiting moderation.

    Amazing write ups. Regards.

    viagra drugs zenegra viagra 25
    viagra generic
    hamster viagra jokes – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  4. Your comment is awaiting moderation.

    Reliable forum posts. Many thanks!

    fast shipping viagra lyrics abracadabra i’m up like viagra
    viagra generic
    mccain response to viagra healthcare – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  5. Your comment is awaiting moderation.

    Whoa tons of very good advice.

    english viagra viagra twice
    cheap viagra
    how to buy viagra – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  6. Your comment is awaiting moderation.

    Well voiced truly! .

    how much viagra is safe does viagra keep erection after ejaculation
    viagra without a doctor prescription
    viagra generic walmart – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  7. Your comment is awaiting moderation.

    Regards, Terrific information.

    viagra available safe smoking pot and taking viagra
    generic viagra
    viagra modify discount – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  8. Your comment is awaiting moderation.

    Amazing write ups. Appreciate it.

    does viagra make penis bigger cheap viagra 25mg
    generic viagra online
    is viagra covered under anthem blue – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  9. Your comment is awaiting moderation.

    Superb material. Kudos!

    does viagra help premature ejaculation aaa and viagra
    generic viagra online
    never mix steroids with viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  10. Your comment is awaiting moderation.

    You expressed this fantastically!

    cheapest place to buy viagra viagra ganaric
    generic viagra 100mg
    ecstacy viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  11. Your comment is awaiting moderation.

    You actually explained that superbly!

    viagra online without prescription overnight longer sex on viagra
    viagra without a doctor prescription
    teen wins teddybear with viagra shirt – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  12. Your comment is awaiting moderation.

    Incredible all kinds of good material.

    viagra cialis search viagra viagra find 74k generic
    cheap viagra
    viagra alternative natura – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  13. Your comment is awaiting moderation.

    Superb postings. Regards!

    funny weather viagra maps large viagra dicks
    generic viagra 100mg
    viagra fir women – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  14. Your comment is awaiting moderation.

    This is nicely put. .

    cheapest viagra online in the uk us made viagra
    viagra 100mg
    what’s the generic name for viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  15. Your comment is awaiting moderation.

    Truly plenty of terrific advice.

    viagra protester foreign generic viagra
    viagra generic
    womens viagra increase female libido – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  16. Your comment is awaiting moderation.

    You said it very well..

    combining levitra and viagra caverta cheap cialis generic viagra
    viagra for sale uk
    viagra through customs from mexico – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  17. Your comment is awaiting moderation.

    You said it nicely..

    cheapest viagra in the world baby boomers euthanasia instead of viagra
    cheap viagra
    mens health natural viagra – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  18. Your comment is awaiting moderation.

    Cheers, Loads of stuff.

    viagra how long it lasts generic viagra report
    generic viagra online
    find viagra free sites computer – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  19. Your comment is awaiting moderation.

    Lovely forum posts. Appreciate it!

    watermelon is like viagra viagra facts
    viagra without a doctor prescription
    viagra on line pharmacy – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  20. Your comment is awaiting moderation.

    Cheers, Fantastic information.

    can viagra prevent premature ejaculation viagra carolina meds online
    viagra generic
    buying viagra in amsterdam – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  21. Your comment is awaiting moderation.

    Thanks a lot. Ample knowledge.

    viagra hearing loss studies pill viagra
    buy viagra online
    buy discreet medical viagra – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  22. Your comment is awaiting moderation.

  23. Your comment is awaiting moderation.

    With thanks. Great stuff.

    viagra onlines cheap canadian generic viagra
    viagra generic
    viagra in mexico for sale – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  24. Your comment is awaiting moderation.

    Point very well considered!.

    can viagra be applied topically viagra user reviews
    buy viagra
    viagra buy price iframe – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  25. Your comment is awaiting moderation.

    Nicely put, With thanks!

    female enhancement liquid version viagra niagra what is viagra used for gt
    viagra for women
    mccain utube viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  26. Your comment is awaiting moderation.

    You actually explained that superbly.

    scam natural viagra truth about generic viagra
    buy generic viagra
    drug to reverse viagra overdose – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  27. Your comment is awaiting moderation.

    Useful write ups. Thanks!

    viagra generic soft tab 3.43 n online order viagra
    viagra 100mg
    discount viagra generic – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  28. Your comment is awaiting moderation.

    Amazing data. Appreciate it!

    calcium channel blockers viagra what does viagra do
    viagra for sale uk
    over the counter viagra similar – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  29. Your comment is awaiting moderation.

    This is nicely expressed. .

    altace and viagra don’t mix viagra with steroids photo
    viagra 100mg
    voto eletronico viagra eleitores passivos – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  30. Your comment is awaiting moderation.

    Fantastic posts. Thanks a lot!

    viagra online fedex viagra erection continues after sex
    generic viagra 100mg
    viagra efects – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  31. Your comment is awaiting moderation.

    You actually reported it terrifically.

    generic cialis soft viagra viagra horas
    generic viagra
    viagra edinburgh search site find – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  32. Your comment is awaiting moderation.

    You actually said this terrifically.

    viagra cutting the pills in half opposite reaction to viagra
    viagra without a doctor prescription
    viagra usage reviews – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  33. Your comment is awaiting moderation.

    Well voiced truly! .

    viagra websites viagra and sinusitis
    buy generic viagra
    tramadol viagra – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  34. Your comment is awaiting moderation.

    Nicely put. Appreciate it.

    viagra chewable tablets viagra update on its lawsuit 2008
    generic viagra 100mg
    generic viagra contains sildenafil citrate – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  35. Your comment is awaiting moderation.

    Nicely put, Kudos!

    how to get a viagra prescription faq about viagra
    viagra for sale uk
    professional viagra cheap – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  36. Your comment is awaiting moderation.

    Incredible a lot of awesome information.

    could viagra help men achieve orgasm viagra benefits
    buy viagra online
    name of female viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  37. Your comment is awaiting moderation.

  38. Your comment is awaiting moderation.

    Wonderful info. Regards!

    viagra religious discrimination is viagra available on the nhs
    generic viagra 100mg
    viagra over the counter mexico – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  39. Your comment is awaiting moderation.

    Nicely put. Thank you.

    cialis better than viagra citrate generic name sildenafil viagra
    viagra for women
    viagra for pet – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  40. Your comment is awaiting moderation.

    Cheers. Great information!

    viva viagra video viagra sealis
    viagra 100mg
    generic viagra in the us – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  41. Your comment is awaiting moderation.

    Nicely put. Thanks a lot.

    teen viagra useage cialis viagra ranbaxy cheap
    generic viagra
    viagra duration – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  42. Your comment is awaiting moderation.

    Thanks a lot. Ample material!

    viagra stories success cialis viagra sampler
    cheap viagra
    lowest price usa viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  43. Your comment is awaiting moderation.

    You said it really well.

    viagra internet sales can viagra aggravate hemorrhoids
    viagra without a doctor prescription
    best herbal viagra – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  44. Your comment is awaiting moderation.

    Good facts, Many thanks.

    connecticut viagra caverta generic veega legally purchase viagra
    viagra generic
    x cite herbal viagra for woman – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  45. Your comment is awaiting moderation.

    Kudos. I enjoy this.

    generic viagra compared viagra online switzerland
    viagra generic
    buy generic viagra img – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  46. Your comment is awaiting moderation.

    You made your position quite nicely!.

    low-priced buy cheap viagra online garland viagra home
    buy viagra online
    silagra generic viagra silagra cumwithuscom – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  47. Your comment is awaiting moderation.

    Whoa a good deal of good knowledge!

    viagra cardiovascular activity does viagra last longer
    buy viagra
    extend or viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  48. Your comment is awaiting moderation.

    Nicely put, Cheers!

    counterfeit viagra infrared order viagra from candian pharmi acies
    buy generic viagra
    viagra online au – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  49. Your comment is awaiting moderation.

    You actually revealed it terrifically!

    viagra chinese red historic price viagra
    buy viagra online
    what pill works like viagra – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  50. Your comment is awaiting moderation.

    Many thanks. A good amount of information.

    anal viagra free sample viagra woman
    generic viagra 100mg
    canadian pharmacy otc viagra – https://genericviagrantx.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  51. Your comment is awaiting moderation.

    You actually suggested it effectively!

    female viagra virginia card com viagra
    viagra pills
    shelf life viagra generic – https://genericviagramsl.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

  52. Your comment is awaiting moderation.

    Appreciate it. A lot of advice!

    effects viagra 200mg chew viagra
    viagra 100mg
    over the conter viagra – https://genericviagrarcp.com

    Geraldthulk
    Dwaynedub
    Kevinsuiva

Leave a Reply

Your email address will not be published. Required fields are marked *