{"id":194,"date":"2012-06-13T18:00:41","date_gmt":"2012-06-13T18:00:41","guid":{"rendered":"http:\/\/miguelontheweb.com\/wordpress\/?p=194"},"modified":"2012-06-13T18:02:08","modified_gmt":"2012-06-13T18:02:08","slug":"odp-net-webservices","status":"publish","type":"post","link":"http:\/\/miguelontheweb.com\/wordpress\/?p=194","title":{"rendered":"Getting started with ODP.net and .Net Web Services"},"content":{"rendered":"<p>ODP.net is oracle\u2019s data provider for .net. I have been using it now for almost 3 year and I absolutely enjoy how tightly integrated it is with Microsoft. Yes you can use Microsoft\u2019s oracle data provider but you will not get all the bell and whistles that you will get with ODP.net. <!--more-->In this article we will be looking at how to leverage ODP.net to retrieve data from the database and use it in a web service.<\/p>\n<p>Prerequisites &#8211;\u00a0\u00a0A basic VB understanding, otherwise you can pick it up as you go along. You should also have and oracle express database instance installed. If you do not have the database go <a title=\"here\" href=\"http:\/\/www.oracle.com\/technetwork\/products\/express-edition\/downloads\/index.html\">here <\/a> to download the database and if you dont have the oracle tools install you can get those from <a href=\"http:\/\/www.oracle.com\/technetwork\/topics\/dotnet\/utilsoft-086879.html\">here<\/a>.<\/p>\n<p>I will be using Visual Studio 2010 as my development tool but you can use visual Studio 2005 on forth and it will work.<\/p>\n<p>&nbsp;<\/p>\n<p>To start lets create a web service.<\/p>\n<p>1.Go to file-&gt;new Web Site -&gt; ASP.NET\u00a0 Web Service<\/p>\n<p><a href=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-212\" title=\"image1\" src=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image11-205x300.png\" alt=\"filemenu\" width=\"205\" height=\"300\" srcset=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image11-205x300.png 205w, http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image11.png 324w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-205\" title=\"image2\" src=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image2-300x207.png\" alt=\"\" width=\"300\" height=\"207\" srcset=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image2-300x207.png 300w, http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image2.png 955w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You should now be looking at a screen that looks like this.<\/p>\n<p><a href=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-216\" title=\"image3\" src=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image3-300x171.png\" alt=\"startScreen\" width=\"300\" height=\"171\" srcset=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image3-300x171.png 300w, http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image3-1024x585.png 1024w, http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image3.png 1090w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we need to make all of our references to the odp.net DLL&#8217;s. Right click the project and choose <strong>&#8220;Add Reference&#8221;<\/strong><\/p>\n<figure id=\"attachment_217\" aria-describedby=\"caption-attachment-217\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-217\" title=\"image4\" src=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image4-300x194.png\" alt=\"\" width=\"300\" height=\"194\" srcset=\"http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image4-300x194.png 300w, http:\/\/miguelontheweb.com\/wordpress\/wp-content\/uploads\/2012\/06\/image4.png 822w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-217\" class=\"wp-caption-text\">dll_reference<\/figcaption><\/figure>\n<p>And thats it! you are now ready to start sending commands to the oracle database of your choice.<\/p>\n<p>In my next arcticle I&#8217;ll show you\u00a0 how to call a procedure, function , or just do simple sql statements against the oracle database using ODP.net<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ODP.net is oracle\u2019s data provider for .net. I have been using it now for almost 3 year and I absolutely enjoy how tightly integrated it is with Microsoft. Yes you can use Microsoft\u2019s oracle data provider but you will not get all the bell and whistles that you will get with ODP.net.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-vb-net"],"_links":{"self":[{"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":28,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":282,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/282"}],"wp:attachment":[{"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/miguelontheweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}