{"id":2212,"date":"2012-05-15T21:23:09","date_gmt":"2012-05-16T02:23:09","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2212"},"modified":"2012-05-15T21:23:45","modified_gmt":"2012-05-16T02:23:45","slug":"simple-example-of-c-program-accessing-oracle","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/05\/15\/simple-example-of-c-program-accessing-oracle\/","title":{"rendered":"Simple example of C# program accessing Oracle"},"content":{"rendered":"<p>Nothing big, just a placeholder for an example of what is in the subject line.<\/p>\n<pre lang=\"c\" line=\"1\">\r\n\/\/C:\\Users\\showard>C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe  \/r:\"C:\\oracle\\product\\11.2.0\\client_1\\ODP.NET\\bin\\2.x\\Oracle.DataAccess.dll\" checkConn.cs\r\n\r\nusing System;\r\nusing Oracle.DataAccess.Client; \r\n\r\npublic class checkConn {\r\n  public static void Main(String []args){\r\n    OracleConnection conn = new OracleConnection(\"User Id=biztalk;Password=********;Data Source=fn9dev\");\r\n    OracleDataReader rdr;\r\n    try {\r\n      conn.Open();\r\n      OracleCommand cmd = new OracleCommand(\"select sysdate from dual\", conn);\r\n      rdr = cmd.ExecuteReader();\r\n      while (rdr.Read())\r\n        Console.WriteLine(\"Server time is \" + rdr[0]);\r\n      conn.Dispose();\r\n    }\r\n    catch(Exception e) {\r\n      Console.WriteLine(e);\r\n    }\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Nothing big, just a placeholder for an example of what is in the subject line. \/\/C:\\Users\\showard>C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe \/r:&#8221;C:\\oracle\\product\\11.2.0\\client_1\\ODP.NET\\bin\\2.x\\Oracle.DataAccess.dll&#8221; checkConn.cs using System; using Oracle.DataAccess.Client; public class checkConn { public static void Main(String []args){ OracleConnection conn = new OracleConnection(&#8220;User Id=biztalk;Password=********;Data Source=fn9dev&#8221;); OracleDataReader rdr;&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/05\/15\/simple-example-of-c-program-accessing-oracle\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[39,24],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2212"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2212"}],"version-history":[{"count":9,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2212\/revisions"}],"predecessor-version":[{"id":2244,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2212\/revisions\/2244"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}