<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx</link><description>In SqlClient Managed Provider, there has always existed (right from ADO.Net 1.0 days) a keyword in the connection string called AttachDbFileName. The user could have the location of the database file assigned to this keyword in the connection string and</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#486288</link><pubDate>Fri, 28 Oct 2005 20:05:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486288</guid><dc:creator>Mayoor Patel</dc:creator><description>I don't know how it is going to be useful, as in your example, you still hardcoded the path.&lt;br&gt;&lt;br&gt;&amp;gt;AppDomain.CurrentDomain.setData(“DataDirectory”,”C:\newPath\”);&lt;br&gt;&lt;br&gt;Rather in such cases it is preferable to use AppSettings.&lt;br&gt;&lt;br&gt;   SqlConnection c = new SqlConnection (@“Data Source=.\SQLEXPRESS; Integrated Security=True;&amp;quot;+&lt;br&gt;&lt;br&gt;e.g.                     @&amp;quot;AttachDbFilename=&amp;quot; AppSettings(&amp;quot;MyDataFilePath&amp;quot;) + &amp;quot;\Company.mdf;Initial Catalog=Company&amp;quot;);&lt;br&gt;   c.Open();&lt;br&gt;&lt;br&gt;where MyDataFilePath is defined either in &amp;quot;AppSettings&amp;quot; section of App.Config or Web.Config.</description></item><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#486310</link><pubDate>Fri, 28 Oct 2005 20:37:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486310</guid><dc:creator>DataWorksBlog</dc:creator><description>Mayoor, Thanks for the feedback on the post. The ideal approach would be to put one single connection string (with the substitution string)in your configuration files and then change the Substitution strings in your code based on custom logic. The example above was to just illustrate how to add custom paths, I agree that it is a good idea to have the path defined in some other config file to reuse in you code. In doing so, you wont have to change your connection string with the above example.</description></item><item><title>one question, though</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#490237</link><pubDate>Tue, 08 Nov 2005 10:37:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:490237</guid><dc:creator>Sam</dc:creator><description>what would happen if you use |DataDirectory| connecting to a different computer - for example the program could be running on a xp comp named 'kurt', and connects to a SBS 2003 running the SQL Server named 'karin' - the SBS 2003 server can't store the database on the xp client, so where will it go, pathwise?</description></item><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#496586</link><pubDate>Thu, 24 Nov 2005 10:03:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:496586</guid><dc:creator>Pragya</dc:creator><description>Useful post. I could not find this little bit of information on msdn though!</description></item><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#510772</link><pubDate>Mon, 09 Jan 2006 16:57:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:510772</guid><dc:creator>Kevin Jones</dc:creator><description>Sushil,&lt;br&gt;&lt;br&gt;can you confirm that AppDomain.CurrentDomain.SetData(&amp;quot;DataDirectory&amp;quot;, &amp;quot;path-to-dir&amp;quot;) still works in the RTM bits?&lt;br&gt;&lt;br&gt;I've had this working but it's now stopped and I've seen other blog entries claiming this doesn't work. I wonder if there was some change between a late beta/CTP and the release</description></item><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#513452</link><pubDate>Mon, 16 Jan 2006 23:04:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:513452</guid><dc:creator>Sushil Chordia</dc:creator><description>Pragya, Thanks for your feedback.&lt;br&gt;-Sushil</description></item><item><title>re: ADO.Net 2.0: Relative paths in ConnectionString [Sushil Chordia]</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#513454</link><pubDate>Mon, 16 Jan 2006 23:06:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:513454</guid><dc:creator>Sushil Chordia</dc:creator><description>Kevin, I still see the function (AppDomain::SetData(str, object) being public in the RTM bits. This method has been public since 1.1 days. Here is a link to its documentation. &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemappdomainclasssetdatatopic.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemappdomainclasssetdatatopic.asp&lt;/a&gt; &lt;br&gt;&lt;br&gt;Hope that helps,&lt;br&gt;Sushil Chordia&lt;br&gt;&lt;br&gt;</description></item><item><title>Simon says - SqlExpress, User Instance = true</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#1141995</link><pubDate>Fri, 24 Nov 2006 21:52:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1141995</guid><dc:creator>Simon says - SqlExpress, User Instance = true</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.primetime-software.de/simon.steckermeier/PermaLink,guid,e9648ca4-81e7-4caf-b6d1-400a88a7a598.aspx"&gt;http://www.primetime-software.de/simon.steckermeier/PermaLink,guid,e9648ca4-81e7-4caf-b6d1-400a88a7a598.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>free music videos myspace codes</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#4966108</link><pubDate>Tue, 18 Sep 2007 03:04:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4966108</guid><dc:creator>free music videos myspace codes</dc:creator><description>&lt;p&gt;free music videos myspace codes&lt;/p&gt;
</description></item><item><title>music video codes myspace html</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#4966114</link><pubDate>Tue, 18 Sep 2007 03:04:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4966114</guid><dc:creator>music video codes myspace html</dc:creator><description>&lt;p&gt;music video codes myspace html&lt;/p&gt;
</description></item><item><title>free myspace music background codes video</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#4966118</link><pubDate>Tue, 18 Sep 2007 03:05:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4966118</guid><dc:creator>free myspace music background codes video</dc:creator><description>&lt;p&gt;free myspace music background codes video&lt;/p&gt;
</description></item><item><title>Drugs and Movies &amp;raquo; Data Access blog : ADO.Net 2.0: Relative paths in ConnectionString &amp;#8230;</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#8370794</link><pubDate>Wed, 09 Apr 2008 05:27:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8370794</guid><dc:creator>Drugs and Movies &amp;raquo; Data Access blog : ADO.Net 2.0: Relative paths in ConnectionString &amp;#8230;</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://drugsmoviesblog.info/data-access-blog-adonet-20-relative-paths-in-connectionstring/"&gt;http://drugsmoviesblog.info/data-access-blog-adonet-20-relative-paths-in-connectionstring/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>How to attach mdf in a relative directory | keyongtech</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#9363112</link><pubDate>Thu, 22 Jan 2009 08:18:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9363112</guid><dc:creator>How to attach mdf in a relative directory | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/445835-how-to-attach-mdf-in"&gt;http://www.keyongtech.com/445835-how-to-attach-mdf-in&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | Outdoor Ceiling Fans</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#9670894</link><pubDate>Sun, 31 May 2009 21:43:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9670894</guid><dc:creator> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | Outdoor Ceiling Fans</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://outdoorceilingfansite.info/story.php?id=22789"&gt;http://outdoorceilingfansite.info/story.php?id=22789&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | work from home</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#9761963</link><pubDate>Tue, 16 Jun 2009 16:05:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9761963</guid><dc:creator> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | work from home</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://workfromhomecareer.info/story.php?id=8407"&gt;http://workfromhomecareer.info/story.php?id=8407&lt;/a&gt;&lt;/p&gt;
</description></item><item><title> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | fix my credit</title><link>http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx#9765294</link><pubDate>Wed, 17 Jun 2009 05:44:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9765294</guid><dc:creator> Data Access blog ADO Net 2 0 Relative paths in ConnectionString | fix my credit</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://fixmycrediteasily.info/story.php?id=3237"&gt;http://fixmycrediteasily.info/story.php?id=3237&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>