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.

    Thanks! I like this!
    https://www.viagrawithoutdoctorntx.com/
    viagra side effects four hour erection
    buy generic viagra
    viagra cialis espa ol
    viagra pills

  2. Your comment is awaiting moderation.

    Wonderful information. Thanks.
    https://www.genericviagracubarx.com/
    viagra lil wayne lyrics
    viagra pills
    will hmsa cover viagra
    viagra without a doctors prescription

  3. Your comment is awaiting moderation.

    Cheers, Plenty of posts.

    https://www.viagrawithoutdoctorbnt.com/
    viagra purchase buy
    generic viagra online
    viagra and cialis
    buy viagra

  4. Your comment is awaiting moderation.

    You have made your position very effectively!.
    https://www.viagrawithoutdoctorntx.com/
    las vegas kamagra viagra about
    cheap viagra
    hur l nge h ller viagra
    generic viagra 100mg

  5. Your comment is awaiting moderation.

    Cheers. Quite a lot of knowledge!

    https://www.viagrawithoutdoctormsn.com/
    where can i purchase viagra
    buy viagra
    free sample generic viagra
    viagra generic

  6. Your comment is awaiting moderation.

    Good material. Regards.
    https://www.genericviagracubarx.com/
    viagra pill pictures
    generic viagra online
    india generic viagra
    generic viagra 100mg

  7. Your comment is awaiting moderation.

    Kudos, Lots of data.

    https://www.viagrawithoutdoctorbnt.com/
    viagra masturbation
    generic viagra
    viagra to treat pulmonary hypertension
    viagra online

  8. Your comment is awaiting moderation.

    Amazing a lot of fantastic info.
    https://www.genericviagracubarx.com/
    viagra in cream
    viagra for women
    overnight viagra brand
    generic viagra 100mg

  9. Your comment is awaiting moderation.

    Thanks, A good amount of advice.

    https://www.genericviagracubarx.com/
    viagra sex
    cheap viagra
    chinese viagra buy
    viagra without a doctors prescription

  10. Your comment is awaiting moderation.

    Reliable forum posts. Many thanks!
    https://www.viagrawithoutdoctorntx.com/
    viagra’s lowest price on the internet
    viagra without a doctors prescription
    pink viagra
    viagra 100mg

  11. Your comment is awaiting moderation.

    Nicely put. Thanks!
    https://www.viagrawithoutadoctorsmim.com/
    viagra angeles philippines
    viagra without a doctor prescription
    viagra miligram
    buy generic viagra

  12. Your comment is awaiting moderation.

    Regards, Loads of info.

    https://www.viagrawithoutdoctorbnt.com/
    viagra purchase
    buy generic viagra
    viagra tesco
    generic viagra 100mg

  13. Your comment is awaiting moderation.

    Many thanks, Quite a lot of advice.

    https://www.genericviagracubarx.com/
    viagra selges
    buy viagra
    700 million classaction lawsuit against viagra
    generic viagra online

  14. Your comment is awaiting moderation.

    Regards. Awesome information.
    https://www.viagrawithoutdoctormsn.com/
    generic viagra super active canada
    generic viagra 100mg
    effexor and viagra
    viagra without a doctors prescription

  15. Your comment is awaiting moderation.

    Thanks a lot! A lot of forum posts.

    https://www.viagrawithoutdoctorntx.com/
    subaction showcomments viagra thanks newest
    viagra without a doctor prescription
    cheap generic kamagra kamagra uk viagra
    viagra for sale uk

  16. Your comment is awaiting moderation.

    Well spoken of course! .
    https://www.viagrawithoutdoctorntx.com/
    coffee and viagra
    viagra without a doctors prescription
    viagra s ljes
    generic viagra

  17. Your comment is awaiting moderation.

    Valuable advice. Cheers.
    https://www.viagrawithoutdoctorbnt.com/
    where to get viagra forum
    viagra without a doctor prescription
    shop for viagra cheap
    buy viagra

  18. Your comment is awaiting moderation.

    Thank you! Quite a lot of postings!

    https://www.genericviagracubarx.com/
    viagra altitude
    viagra generic
    viagra high altitude sickness
    generic viagra online

  19. Your comment is awaiting moderation.

    You actually said it superbly.
    https://www.viagrawithoutadoctorsmim.com/
    phizer brand viagra made in canada
    viagra for women
    viagra offical site
    viagra without a doctor prescription

  20. Your comment is awaiting moderation.

    Appreciate it. Plenty of data.

    https://www.viagrawithoutdoctormsn.com/
    viagra cheap uk buy purchase
    buy viagra online
    viagra military
    viagra 100mg

  21. Your comment is awaiting moderation.

    Thanks a lot! Loads of posts.

    https://www.viagrawithoutdoctorntx.com/
    alternate viagra
    viagra for women
    took two viagra at once
    viagra without a doctors prescription

  22. Your comment is awaiting moderation.

    Reliable write ups. Many thanks!
    https://www.viagrawithoutadoctorsmim.com/
    generic mexican viagra
    viagra for sale uk
    shemales and viagra
    generic viagra 100mg

  23. Your comment is awaiting moderation.

    Superb facts, Thank you.
    https://www.genericviagracubarx.com/
    q viagra meta
    viagra generic
    cheapest viagra prices without a prescription
    viagra without a doctor prescription

  24. Your comment is awaiting moderation.

    Regards, Quite a lot of facts.

    https://www.genericviagracubarx.com/
    viagra viagra find edinburgh pages search
    viagra without a doctor prescription
    genertic viagra cheapest
    cheap viagra

  25. Your comment is awaiting moderation.

    Thank you. Helpful information.
    https://www.viagrawithoutdoctormsn.com/
    stop viagra spam
    buy viagra online
    buy viagra iframe
    generic viagra

  26. Your comment is awaiting moderation.

    You said it nicely.!
    https://www.viagrawithoutdoctorntx.com/
    my viagra did not work
    generic viagra 100mg
    generic viagra caverta 2c cialis cheap
    buy viagra

  27. Your comment is awaiting moderation.

    Valuable data. Many thanks!
    https://www.viagrawithoutdoctormsn.com/
    low cost viagra online
    buy generic viagra
    viagra discount code
    viagra generic

  28. Your comment is awaiting moderation.

    You have made your position extremely effectively!.
    https://www.viagrawithoutdoctorbnt.com/
    viagra inc
    viagra generic
    viagra erection duration
    viagra for women

  29. Your comment is awaiting moderation.

    Terrific facts. Regards!
    https://www.viagrawithoutdoctorbnt.com/
    viagra in 1998
    generic viagra online
    viagra delivery two days
    viagra for sale uk

  30. Your comment is awaiting moderation.

    With thanks, I value it!
    https://www.viagrawithoutdoctormsn.com/
    cheap viagra online a href
    viagra pills
    achat viagra france
    cheap viagra

  31. Your comment is awaiting moderation.

    Whoa many of valuable information!
    https://www.viagrawithoutdoctorntx.com/
    viagra larger forever
    viagra 100mg
    generic viagra pharmacy
    viagra online

  32. Your comment is awaiting moderation.

    Whoa all kinds of wonderful advice!
    https://www.viagrawithoutdoctorbnt.com/
    viagra and neurological side effects
    generic viagra 100mg
    the miller firm viagra lawsuits
    generic viagra online

  33. Your comment is awaiting moderation.

    Truly lots of great facts!
    https://www.viagrawithoutadoctorsmim.com/
    buy viagra from canada or mexico
    viagra for women
    3generic meltabs viagra
    viagra without a doctor prescription

  34. Your comment is awaiting moderation.

    Amazing forum posts, With thanks.
    https://www.genericviagracubarx.com/
    filagra viagra soft-100 chewable
    cheap viagra
    allentown viagra
    buy viagra

  35. Your comment is awaiting moderation.

    You’ve made your stand extremely effectively.!
    https://www.viagrawithoutdoctorntx.com/
    viagra online fedex overnight shipping
    viagra online
    find sites computer shop viagra
    generic viagra 100mg

  36. Your comment is awaiting moderation.

    You actually revealed it very well.
    https://www.viagrawithoutdoctormsn.com/
    viagra pill for woman
    viagra pills
    viagra email virus
    generic viagra

  37. Your comment is awaiting moderation.

    Excellent forum posts. Thank you.
    https://www.viagrawithoutdoctorntx.com/
    subliminal viagra
    cheap viagra
    viagra 200mg
    buy viagra online

  38. Your comment is awaiting moderation.

    Perfectly expressed without a doubt. !
    https://www.viagrawithoutdoctormsn.com/
    viagra costs
    generic viagra 100mg
    emmanuelle viagra
    viagra pills

  39. Your comment is awaiting moderation.

    You’ve made your position pretty nicely.!
    https://www.genericviagracubarx.com/
    order viagra with mastercard
    viagra without a doctors prescription
    viagra and food
    generic viagra 100mg

  40. Your comment is awaiting moderation.

    Fantastic material. With thanks!
    https://www.genericviagracubarx.com/
    viagra delivered from uk pharmacy
    viagra without a doctors prescription
    private uk viagra prescription
    buy generic viagra

  41. Your comment is awaiting moderation.

    Amazing tons of very good info.
    https://www.viagrawithoutdoctorbnt.com/
    online viagra authentic
    buy viagra online
    jokes birth viagra
    viagra generic

  42. Your comment is awaiting moderation.

    Cheers, Ample postings.

    https://www.viagrawithoutdoctormsn.com/
    viagra birth control discrimination
    viagra without a doctors prescription
    viagra rx
    viagra online

  43. Your comment is awaiting moderation.

    Wonderful information. Appreciate it!
    https://www.viagrawithoutadoctorsmim.com/
    generic lowest price viagra
    viagra generic
    viagra boring pages edinburgh search sites
    generic viagra

  44. Your comment is awaiting moderation.

    Seriously lots of awesome knowledge.
    https://www.viagrawithoutdoctorntx.com/
    price of viagra in canada
    buy viagra
    viagra graphic
    buy generic viagra

  45. Your comment is awaiting moderation.

    Regards. Numerous data!

    https://www.viagrawithoutdoctorntx.com/
    viagra enjoyable to women
    generic viagra 100mg
    natural herbs that act like viagra
    viagra for women

  46. Your comment is awaiting moderation.

    Thanks a lot, I like it.
    https://www.genericviagracubarx.com/
    generic viagra erections time year
    viagra without a doctor prescription
    viagra failures
    generic viagra 100mg

  47. Your comment is awaiting moderation.

    Fine tips. Regards!
    https://www.viagrawithoutdoctorntx.com/
    poland viagra
    viagra for women
    viagra affiliate
    viagra generic

  48. Your comment is awaiting moderation.

    Very good facts. Many thanks!
    https://www.viagrawithoutadoctorsmim.com/
    cialis mix viagra
    viagra for sale uk
    viagra video results
    viagra generic

  49. Your comment is awaiting moderation.

    You definitely made the point!
    https://www.genericviagracubarx.com/
    viagra user forum
    buy viagra
    edinburgh uk viagra href pages computer
    viagra 100mg

  50. Your comment is awaiting moderation.

    Incredible a good deal of very good advice!
    https://www.viagrawithoutdoctorbnt.com/
    phentermine and viagra
    viagra online
    canadian pharmacy cheap generic viagra
    cheap viagra

  51. Your comment is awaiting moderation.

    Thanks. A good amount of info!

    https://www.genericviagracubarx.com/
    when viagra and levitra doesn’t work
    buy viagra
    prostitution viagra speed thailand
    viagra pills

  52. Your comment is awaiting moderation.

    You actually reported it superbly.
    https://www.viagrawithoutadoctorsmim.com/
    viagra perscription online
    cheap viagra
    viagra pill
    cheap viagra

  53. Your comment is awaiting moderation.

    Great data. Regards!
    https://www.viagrawithoutdoctormsn.com/
    drug viagra zenegra
    generic viagra 100mg
    prazosin impotence viagra
    viagra pills

  54. Your comment is awaiting moderation.

    Nicely put, Thank you!
    https://www.genericviagracubarx.com/
    generic viagra 100mg 100 tabs
    viagra without a doctor prescription
    viagra 2011 cost
    buy viagra

  55. Your comment is awaiting moderation.

    You actually mentioned this very well!
    https://www.viagrawithoutdoctormsn.com/
    viagra to ireland
    buy viagra
    viagra andnot generic
    viagra for sale uk

  56. Your comment is awaiting moderation.

    Nicely put, Thanks.
    https://www.viagrawithoutdoctorntx.com/
    viagra generic uk
    viagra online
    wife gave viagra dog
    viagra without a doctors prescription

  57. Your comment is awaiting moderation.

    Wonderful posts, Many thanks!
    https://www.viagrawithoutadoctorsmim.com/
    viagra online href foro forum
    viagra without a doctors prescription
    viagra without prescription free
    generic viagra

  58. Your comment is awaiting moderation.

    Thanks! Loads of info.

    https://www.genericviagracubarx.com/
    emanuelle viagra
    viagra without a doctors prescription
    viagra energy drink
    buy generic viagra

  59. Your comment is awaiting moderation.

    With thanks. I appreciate this!
    https://www.genericviagracubarx.com/
    does viagra help for multiple orgasms
    cheap viagra
    viagra boner
    viagra for women

  60. Your comment is awaiting moderation.

    Cheers, I value it.
    https://www.viagrawithoutdoctormsn.com/
    viagra addiction
    viagra generic
    will viagra work for my wife
    generic viagra 100mg

  61. Your comment is awaiting moderation.

    Many thanks! Numerous data.

    https://www.viagrawithoutadoctorsmim.com/
    the woman’s viagra
    buy generic viagra
    buy lady uk viagra
    viagra for sale uk

  62. Your comment is awaiting moderation.

    Helpful content. Kudos!
    https://www.viagrawithoutdoctorbnt.com/
    average viagra price
    generic viagra
    massage viagra
    viagra online

  63. Your comment is awaiting moderation.

    Kudos! Wonderful stuff!
    https://www.viagrawithoutdoctorntx.com/
    distribution channel of viagra
    viagra without a doctors prescription
    viagra demonstrate
    buy generic viagra

  64. Your comment is awaiting moderation.

    You said it really well!
    https://www.genericviagracubarx.com/
    viagra online overnight next day shipping
    viagra without a doctor prescription
    feedblitz news edinburgh pages viagra
    generic viagra

  65. Your comment is awaiting moderation.

    Thank you. Quite a lot of knowledge!

    http://viagrawithoutadoctorsntx.com/
    time of day to take viagra
    viagra 100mg
    homopathic viagra
    generic viagra 100mg

  66. Your comment is awaiting moderation.

    Superb knowledge. Many thanks!
    http://viagrawithoutadoctorsntx.com/
    canadian mail order viagra
    buy generic viagra
    viagra infidelity studies
    viagra for women

  67. Your comment is awaiting moderation.

    Wonderful forum posts, Thank you!
    http://viagrawithoutadoctorsntx.com/
    viagra cursor
    viagra without a doctor prescription
    find viagra free online search
    cheap viagra

  68. Your comment is awaiting moderation.

    Reliable facts. Thank you!
    http://viagrawithoutadoctormsn.com/
    feamal viagra
    viagra online
    viagra and patent protection
    buy viagra

  69. Your comment is awaiting moderation.

    Truly quite a lot of wonderful knowledge.
    http://viagrawithoutadoctorsntx.com/
    viagra wallpaper
    generic viagra 100mg
    avodart flomax prostate viagra
    viagra for women

  70. Your comment is awaiting moderation.

    You stated that adequately.
    http://viagrapego.com/
    if viagra doesn’t work
    cheap viagra
    settlement on viagra in the courts
    buy generic viagra

  71. Your comment is awaiting moderation.

    Seriously all kinds of excellent data!
    http://viagrawithoutadoctormsn.com/
    viagra results pictures
    buy viagra online
    find viagra cheap overnight mail
    viagra online

  72. Your comment is awaiting moderation.

    Thanks a lot. I value it!
    http://viagrawithoutadoctorsntx.com/
    animals on viagra
    generic viagra
    viagra at gnc
    viagra without a doctors prescription

  73. Your comment is awaiting moderation.

    You actually mentioned that terrifically.
    http://viagrawithoutadoctormsn.com/
    craigslist viagra toronto
    viagra for women
    buy viagra from canada or mexico
    viagra pills

Leave a Reply

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