{"id":2485,"date":"2013-11-21T16:10:17","date_gmt":"2013-11-21T20:10:17","guid":{"rendered":"http:\/\/www.iowawebnet.com\/ein\/?p=2485"},"modified":"2014-02-19T15:35:28","modified_gmt":"2014-02-19T19:35:28","slug":"how-to-get-getconnectionstring","status":"publish","type":"post","link":"https:\/\/www.iowawebnet.com\/ein\/2013\/11\/how-to-get-getconnectionstring\/","title":{"rendered":"How to get GetConnectionString()"},"content":{"rendered":"<p>VB<\/p>\n<pre>\r\n\r\n<code>\r\nPublic Shared Function GetConnectionString() As String\r\n      Return ConfigurationManager.ConnectionStrings(\"ConnectionString\").ToString()\r\n       \r\n        ' access properties\r\n        ' if access driver is NOT installed on machine - most possible\r\n        Return \"Driver={Microsoft Access Driver (*.mdb, *.accdb)}; \r\n                 DBQ=C:\\Projects\\MyProject\\DataSource\\ProjectDB.accdb\"\r\n\r\n        ' if access driver is installed on machine\r\n        Return \"DSN=CrescoOelweinMerger; \r\n                DBQ=C:\\Projects\\MyProject\\DataSource\\ProjectDB.accdb\"\r\nEnd Function\r\n<\/code>\r\n<\/pre>\n<p>C# <a style=\"display:none;\" id=\"te1108823007\" href=\"javascript:expand('#te1108823007')\">Read more&#8230;<\/a>\n<div class=\"te_div\" id=\"te1108823007\"><script language=\"JavaScript\" type=\"text\/javascript\">expander_hide('#te1108823007');<\/script><\/p>\n<pre>\r\n\r\n<code>\r\npublic static string GetConnectionString()\r\n  {\r\n     return ConfigurationManager.ConnectionStrings[\"ConnectionString\"].ToString();\r\n  }\r\n<\/code>\r\n<\/pre>\n<p><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>VB Public Shared Function GetConnectionString() As String Return ConfigurationManager.ConnectionStrings(&#8220;ConnectionString&#8221;).ToString() &#8216; access properties &#8216; if access driver is NOT installed on machine &#8211; most possible Return &#8220;Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\\Projects\\MyProject\\DataSource\\ProjectDB.accdb&#8221; &#8216; if access driver is installed on machine Return &#8220;DSN=CrescoOelweinMerger; DBQ=C:\\Projects\\MyProject\\DataSource\\ProjectDB.accdb&#8221; End Function C# Read more&#8230; public static string GetConnectionString() { return ConfigurationManager.ConnectionStrings[&#8220;ConnectionString&#8221;].ToString(); }<\/p>\n","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85,16],"tags":[],"class_list":["post-2485","post","type-post","status-publish","format-standard","hentry","category-net-4-0","category-net"],"_links":{"self":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2485"}],"collection":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/comments?post=2485"}],"version-history":[{"count":7,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2485\/revisions"}],"predecessor-version":[{"id":2515,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/posts\/2485\/revisions\/2515"}],"wp:attachment":[{"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/media?parent=2485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/categories?post=2485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iowawebnet.com\/ein\/wp-json\/wp\/v2\/tags?post=2485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}