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 enjoy it!
    http://cialisttk.com/
    price of daily cialis
    cialis without a doctor prescription
    cialis von lilly pharma
    generic cialis

  2. Your comment is awaiting moderation.

    Thank you. Plenty of data.

    https://www.cialisfidel.com/
    commande cialis 20mg
    cheap cialis
    cialis Г  l unitГ©
    cialis generic

  3. Your comment is awaiting moderation.

    You said it very well.!
    https://www.cialisfidel.com/
    cialis miracoloso
    cialis online
    comprar cialis porto alegre
    cialis online

  4. Your comment is awaiting moderation.

    Amazing a lot of amazing tips!
    http://cialismsnntx.com/
    cialis avec alcool
    cialis without a doctor prescription
    cialis diario araujo
    cialis without a doctor prescription

  5. Your comment is awaiting moderation.

    Kudos! I appreciate it.
    https://www.cialisfidel.com/
    cialis 10 pmp
    cialis without a doctor prescription
    recensioni su cialis
    cheap cialis

  6. Your comment is awaiting moderation.

    Thanks. Quite a lot of info.

    http://cialisttk.com/
    blanda viagra i cialis
    cheap cialis
    wordpress hacked cialis
    cialis generic

  7. Your comment is awaiting moderation.

    Fantastic info. Thanks a lot.
    https://www.cialismim.com/
    acheter cialis au quebec
    cialis 20 mg
    chi produce cialis
    generic cialis

  8. Your comment is awaiting moderation.

    You made the point!
    http://cialismsnntx.com/
    saturday night live cialis for threeways
    generic cialis
    cerco cialis
    cheap cialis

  9. Your comment is awaiting moderation.

    You said it adequately.!
    http://cialispego.com/
    cialis and viagra together at once
    cialis 20 mg
    köpa cialis flashback
    cialis online

  10. Your comment is awaiting moderation.

    You made your stand quite nicely..
    http://cialismsnntx.com/
    cialis 10mg pills
    cialis 20mg
    cialis eczaneden alД±nД±r mД±
    cialis without a doctor prescription

  11. Your comment is awaiting moderation.

    Great content. With thanks.
    http://cialismsnntx.com/
    cialis patient reviews
    cialis 20mg
    cialis les effets secondaires
    buy cialis online

  12. Your comment is awaiting moderation.

    You expressed that superbly.
    http://cialismsnntx.com/
    buy cialis for daily use online
    cialis generic
    meilleur site pour du cialis
    cialis 20 mg

  13. Your comment is awaiting moderation.

    You have made your position quite well.!
    http://cialispego.com/
    cheap cialis drug
    generic cialis
    gevaren cialis
    cialis 20 mg

  14. Your comment is awaiting moderation.

    You actually reported this well.
    https://www.cialisfidel.com/
    compare cialis levitra staxyn stendra and viagra
    cialis without a doctor prescription
    cialis generika 5mg preisvergleich
    cialis online

  15. Your comment is awaiting moderation.

    Nicely put. Regards!
    http://cialismsnrx.com/
    cialis fat loss
    cialis generic
    cialis 5 mg y viagra
    cialis 20mg

  16. Your comment is awaiting moderation.

    Valuable facts. Appreciate it!
    https://www.cialismim.com/
    cos ГЁ il cialis generico
    generic cialis
    cialis 5mg et prostate
    cheap cialis

  17. Your comment is awaiting moderation.

    Very well voiced of course! .
    http://cialispego.com/
    cialis pharmacy petraeus
    cialis without a doctor prescription
    cialis mit paypal zahlen
    cialis 20 mg

  18. Your comment is awaiting moderation.

    Nicely put. With thanks.
    http://cialismsnntx.com/
    cialis oral gel
    buy cialis online
    viagra cialis predam
    cialis generic

  19. Your comment is awaiting moderation.

    Regards, An abundance of material!

    https://www.cialisfidel.com/
    sobre dosis de cialis
    buy cialis online
    cialis fГіrum index
    cialis generic

  20. Your comment is awaiting moderation.

    Good material, Thank you!
    http://cialismsnrx.com/
    wikipedia cialis viagra
    cialis 20mg
    comprar cialis genГ©rico em portugal
    buy cialis online

  21. Your comment is awaiting moderation.

    Point clearly regarded.!
    https://www.cialisfidel.com/
    forum meilleur site achat cialis
    cialis generic
    cialis can ejaculate
    generic cialis

  22. Your comment is awaiting moderation.

    You stated it terrifically!
    http://cialispego.com/
    qual melhor levitra ou cialis
    cialis 20 mg
    acquistare cialis forum
    cialis 20mg

  23. Your comment is awaiting moderation.

    You reported that effectively.
    http://cialisttk.com/
    cialis non mi fa effetto
    cialis without a doctor prescription
    purchase cialis daily use
    cialis generic

  24. Your comment is awaiting moderation.

    You mentioned that wonderfully.
    http://cialismsnntx.com/
    cialis highest mg
    buy cialis online
    que opinan las mujeres del cialis
    cheap cialis

  25. Your comment is awaiting moderation.

    You actually explained this adequately.
    https://www.cialisfidel.com/
    cialis pulmonary hypertension dose
    cialis 20 mg
    e-cig e-cialis
    buy cialis online

  26. Your comment is awaiting moderation.

    Kudos, Plenty of posts!

    http://cialismsnrx.com/
    cialis gelb
    cialis online
    cialis jak dlugo dziala
    cialis 20 mg

  27. Your comment is awaiting moderation.

    You definitely made your point!
    https://www.cialisfidel.com/
    buy cialis once daily
    cialis 20mg
    what is cialis daily use
    cialis 20mg

  28. Your comment is awaiting moderation.

    Nicely put. Cheers.
    http://cialismsnrx.com/
    como tomar cialis de 5mg
    cheap cialis
    cialis guenstig rezeptfrei
    cialis 20mg

  29. Your comment is awaiting moderation.

    You actually suggested that well.
    http://cialispego.com/
    drugs that interact with cialis
    cialis online
    cialis e glaucoma
    cialis 20 mg

  30. Your comment is awaiting moderation.

    You explained that very well.
    https://www.cialisfidel.com/
    quanto custa o cialis generico
    buy cialis online
    can you get drunk and take cialis
    cialis 20mg

  31. Your comment is awaiting moderation.

    Valuable stuff. With thanks!
    http://cialispego.com/
    diferencia de viagra y cialis
    cialis 20mg
    does viagra work better than cialis
    cialis generic

  32. Your comment is awaiting moderation.

    You definitely made the point.
    http://cialismsnrx.com/
    cialis on line europa
    buy cialis online
    cialis effect duration
    buy cialis online

  33. Your comment is awaiting moderation.

    You said that well.
    https://www.cialismim.com/
    come dividere cialis
    generic cialis
    cialis con receta precio
    generic cialis

  34. Your comment is awaiting moderation.

    Whoa plenty of awesome tips.
    http://cialispego.com/
    cialis 20 mg alkolle kullanД±lД±rmД±
    cheap cialis
    use of cialis after prostatectomy
    generic cialis

  35. Your comment is awaiting moderation.

    Fantastic write ups, Thank you.
    http://cialispego.com/
    original cialis gГјnstig
    cialis 20 mg
    swiss medico cialis
    buy cialis online

  36. Your comment is awaiting moderation.

    Appreciate it. Ample forum posts.

    http://cialismsnntx.com/
    preço medicamento cialis
    cialis online
    generic cialis pattaya
    cialis 20mg

  37. Your comment is awaiting moderation.

    Wonderful facts. Kudos.
    http://cialismsnrx.com/
    cialis et age
    generic cialis
    avis achat cialis en ligne
    cheap cialis

  38. Your comment is awaiting moderation.

    Wonderful material. Regards.
    http://cialispego.com/
    cialis and night sweats
    cialis without a doctor prescription
    qual principio ativo do cialis
    generic cialis

  39. Your comment is awaiting moderation.

    Thank you. Loads of facts!

    http://cialismsnrx.com/
    what does cialis cost in canada
    cialis online
    cialis diario pague menos
    cialis online

  40. Your comment is awaiting moderation.

    With thanks! Wonderful information!
    http://cialispego.com/
    cialis betabloqueantes
    cialis 20 mg
    perbandingan viagra dengan cialis
    cialis 20mg

  41. Your comment is awaiting moderation.

    Very good info. Thank you.
    http://cialismsnntx.com/
    does cialis raise testosterone
    cialis generic
    mixing levitra with cialis
    cialis 20mg

  42. Your comment is awaiting moderation.

    Thanks a lot. Terrific information!
    http://cialispego.com/
    cialis generico prezzo migliore
    cialis without a doctor prescription
    chef de produit cialis
    cialis 20 mg

  43. Your comment is awaiting moderation.

    Wow quite a lot of wonderful information.
    http://cialispego.com/
    cialis 10 mg ou 20 mg
    buy cialis online
    cialis brain fog
    buy cialis online

  44. Your comment is awaiting moderation.

    Appreciate it, Loads of write ups.

    http://cialismsnntx.com/
    cialis 10 mg dopo quanto fa effetto
    cialis generic
    cialis wirkstoffmenge
    cialis online

  45. Your comment is awaiting moderation.

    You definitely made your point!
    http://cialismsnntx.com/
    patente do cialis
    buy cialis online
    cialis in farmacia serve la ricetta
    cialis online

  46. Your comment is awaiting moderation.

    Many thanks! Loads of posts!

    https://www.cialisfidel.com/
    cialis viagra iskustva
    buy cialis online
    cialis prodaja oglasi
    generic cialis

  47. Your comment is awaiting moderation.

    Great info. Regards.
    http://cialispego.com/
    relatos de cialis
    cialis without a doctor prescription
    brand cialis vs generic cialis
    generic cialis

  48. Your comment is awaiting moderation.

    Regards. Good information.
    http://cialisttk.com/
    cialis arginine+zinc
    generic cialis
    cialis a poco prezzo
    cialis without a doctor prescription

  49. Your comment is awaiting moderation.

    Kudos. Valuable stuff.
    http://cialispego.com/
    cialis pills definition
    cialis 20 mg
    cialis caixa com 8 comprimidos
    cialis 20 mg

  50. Your comment is awaiting moderation.

    Amazing tons of wonderful information!
    http://cialispego.com/
    cialis modo uso
    buy cialis online
    daily cialis generic
    cialis without a doctor prescription

  51. Your comment is awaiting moderation.

    Incredible a good deal of good knowledge!
    http://cialismsnrx.com/
    generic super active cialis
    cialis 20mg
    cialis dopo cena
    cialis generic

  52. Your comment is awaiting moderation.

    Nicely put. Thank you!
    http://cialispego.com/
    fast acting cialis
    cialis 20mg
    peut t on avoir du cialis sans ordonnance
    buy cialis online

  53. Your comment is awaiting moderation.

    Useful tips. Thanks.
    http://cialismsnntx.com/
    vad Г¤r generisk cialis
    cheap cialis
    where can i buy cialis yahoo
    cialis without a doctor prescription

  54. Your comment is awaiting moderation.

    You actually expressed that really well.
    http://cialispego.com/
    puedo comprar cialis en cualquier farmacia
    cheap cialis
    cialis spontaneity
    cialis 20 mg

  55. Your comment is awaiting moderation.

    Excellent info. Many thanks.
    http://cialismsnrx.com/
    pros and cons of using cialis
    buy cialis online
    can you take more than one cialis for daily use
    cialis without a doctor prescription

  56. Your comment is awaiting moderation.

    You actually expressed that really well.
    https://www.cialisfidel.com/
    clomipramine and cialis
    cialis online
    cialis 100 fiyatlarД±
    cialis 20mg

  57. Your comment is awaiting moderation.

    Whoa a good deal of amazing tips!
    http://cialismsnrx.com/
    a quand le generique du cialis
    generic cialis
    cialis 10 mg precio mexico
    buy cialis online

  58. Your comment is awaiting moderation.

    Thank you, Loads of data.

    http://cialispego.com/
    why is cialis prescribed
    cialis 20 mg
    prezzi cialis e viagra
    buy cialis online

  59. Your comment is awaiting moderation.

    Many thanks! Awesome information!
    https://www.cialisfidel.com/
    prescrizione per cialis
    cialis online
    forum acheter cialis en ligne
    cialis without a doctor prescription

  60. Your comment is awaiting moderation.

    Regards, Ample tips!

    http://cialispego.com/
    cialis dosierung 10 mg
    cialis online
    where to order cialis online safe
    cialis online

  61. Your comment is awaiting moderation.

    You stated this perfectly.
    http://cialispego.com/
    diferença cialis x viagra
    cialis without a doctor prescription
    forum cialis 2 5 mg
    cialis generic

  62. Your comment is awaiting moderation.

    This is nicely put! .
    http://cialisttk.com/
    differences levitra cialis
    cialis generic
    date du brevet du cialis
    cialis online

  63. Your comment is awaiting moderation.

    Beneficial data. With thanks!
    http://cialisttk.com/
    cialis free 30 days
    cialis 20 mg
    can i take cialis and flomax
    cialis generic

  64. Your comment is awaiting moderation.

    Amazing all kinds of very good material.
    https://www.cialisfidel.com/
    dove comprare cialis generico on line
    generic cialis
    donde comprar cialis de confianza
    generic cialis

  65. Your comment is awaiting moderation.

    Very well voiced really. .
    http://cialismsnntx.com/
    onde comprar cialis 20 mg
    cialis 20 mg
    cialis bez recepty opinie
    cialis without a doctor prescription

  66. Your comment is awaiting moderation.

    Thank you. Quite a lot of posts.

    http://cialismsnntx.com/
    comprar cialis precio
    cheap cialis
    wirkt cialis immer
    cialis generic

  67. Your comment is awaiting moderation.

    Fantastic tips. Thanks.
    http://cialispego.com/
    cialis macht impotent
    cialis 20mg
    does cialis work with antidepressants
    cialis generic

  68. Your comment is awaiting moderation.

    Awesome posts. Thank you.
    http://cialispego.com/
    cialis erfahrungsberichte frauen
    cialis 20mg
    acheter cialis 5mg france
    cialis 20 mg

  69. Your comment is awaiting moderation.

    Great data. Cheers.
    http://cialispego.com/
    que es mejor viagra o cialis
    cheap cialis
    equivalent naturel du cialis
    generic cialis

  70. Your comment is awaiting moderation.

    Nicely put. Kudos.
    http://cialisttk.com/
    cialis u apoteci bez recepta
    cheap cialis
    cialis suomi
    generic cialis

  71. Your comment is awaiting moderation.

    Whoa a good deal of awesome knowledge.
    http://cialismsnntx.com/
    express scripts cialis price
    buy cialis online
    programa fidelidade cialis
    cialis generic

  72. Your comment is awaiting moderation.

    With thanks, Plenty of content.

    http://cialispego.com/
    en que farmacias venden cialis generico en mexico
    cialis online
    cialis red pill
    cialis 20mg

  73. Your comment is awaiting moderation.

    Incredible loads of fantastic info!
    http://cialispego.com/
    cialis for sale sydney
    cheap cialis
    que precio tiene el cialis en farmacia
    cialis 20 mg

Leave a Reply

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