<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Set_DataDirectory_manually</id>
		<title>Set DataDirectory manually - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Set_DataDirectory_manually"/>
		<link rel="alternate" type="text/html" href="https://logicwiki.co.uk/index.php?title=Set_DataDirectory_manually&amp;action=history"/>
		<updated>2026-04-17T14:22:47Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://logicwiki.co.uk/index.php?title=Set_DataDirectory_manually&amp;diff=189&amp;oldid=prev</id>
		<title>Dt1nh6: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://logicwiki.co.uk/index.php?title=Set_DataDirectory_manually&amp;diff=189&amp;oldid=prev"/>
				<updated>2016-05-09T13:27:24Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:27, 9 May 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Dt1nh6</name></author>	</entry>

	<entry>
		<id>https://logicwiki.co.uk/index.php?title=Set_DataDirectory_manually&amp;diff=188&amp;oldid=prev</id>
		<title>Macrop: Created page with &quot;Category:Database Category:SQL Category:CSharp  In windows applications,   You can manually set your DataDirectory by using '''AppDomain.CurrentDomain.SetData(&quot;Dat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://logicwiki.co.uk/index.php?title=Set_DataDirectory_manually&amp;diff=188&amp;oldid=prev"/>
				<updated>2016-03-23T08:41:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php?title=Category:Database&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Database (page does not exist)&quot;&gt;Category:Database&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:SQL&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:SQL (page does not exist)&quot;&gt;Category:SQL&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:CSharp&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:CSharp (page does not exist)&quot;&gt;Category:CSharp&lt;/a&gt;  In windows applications,   You can manually set your DataDirectory by using &amp;#039;&amp;#039;&amp;#039;AppDomain.CurrentDomain.SetData(&amp;quot;Dat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Database]]&lt;br /&gt;
[[Category:SQL]]&lt;br /&gt;
[[Category:CSharp]]&lt;br /&gt;
&lt;br /&gt;
In windows applications, &lt;br /&gt;
&lt;br /&gt;
You can manually set your DataDirectory by using '''AppDomain.CurrentDomain.SetData(&amp;quot;DataDirectory&amp;quot;, path)'''. &lt;br /&gt;
&lt;br /&gt;
You can get the path of your executable by using AppDomain.CurrentDomain.BaseDirectory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Connection String === &lt;br /&gt;
 Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\LocalDbVisTest.mdf;Integrated Security=True&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
=== Relative path: ===&lt;br /&gt;
&lt;br /&gt;
        ConnectionString = &amp;quot;Data Source=|DataDirectory|\Database.sdf&amp;quot;;&lt;br /&gt;
=== Modifying DataDirectory as executable's path: ===&lt;br /&gt;
&lt;br /&gt;
        string executable = System.Reflection.Assembly.GetExecutingAssembly().Location;&lt;br /&gt;
        string path = (System.IO.Path.GetDirectoryName(executable));&lt;br /&gt;
        AppDomain.CurrentDomain.SetData(&amp;quot;DataDirectory&amp;quot;, path);&lt;/div&gt;</summary>
		<author><name>Macrop</name></author>	</entry>

	</feed>