<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755794</guid>
        <pubDate>Thu, 11 Jan 2018 15:00:45 +0000</pubDate>
        <title>Пример из курса ADO.NET не работает</title>
        <link>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755794</link>
        <description><![CDATA[tumanovalex: Не помогло.]]></description>
        <author>tumanovalex</author>
        <category>.NET: Базы данных</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755712</guid>
        <pubDate>Thu, 11 Jan 2018 06:52:32 +0000</pubDate>
        <title>Пример из курса ADO.NET не работает</title>
        <link>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755712</link>
        <description><![CDATA[kosten: Попробуйте заменить <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">config.Save();</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
на<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">config.Save(ConfigurationSaveMode.Full);</div></ol></div></div></div></div>]]></description>
        <author>kosten</author>
        <category>.NET: Базы данных</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755688</guid>
        <pubDate>Wed, 10 Jan 2018 17:01:11 +0000</pubDate>
        <title>Пример из курса ADO.NET не работает</title>
        <link>https://forum.sources.ru/index.php?showtopic=411836&amp;view=findpost&amp;p=3755688</link>
        <description><![CDATA[tumanovalex: В примере из курса по ADO.NET<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">using System;</div><div class="code_line">using System.Configuration;</div><div class="code_line">&nbsp;</div><div class="code_line">namespace ConnectionStringConfig</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;class Program</div><div class="code_line">&nbsp;&nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp;static void Main(string[] args)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;var setting = new ConnectionStringSettings</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Name = &quot;MyConnectionString1&quot;, &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ConnectionString = @&quot;Data Source=(local); Initial Catalog=ShopDB; Integrated Security=True;&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;};</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Configuration config; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;config.ConnectionStrings.ConnectionStrings.Add(setting);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;config.Save();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Console.WriteLine(&quot;Строка подключения записана в конфигурационный файл.&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Console.WriteLine(ConfigurationManager.ConnectionStrings[&quot;MyConnectionString1&quot;].ConnectionString); // Ошибка</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;Console.ReadKey();</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div> в строке над Console.ReadKey() возникает ошибка &quot;Необработанное исключение типа &quot;System.NullReferenceException&quot; в 006_SQLCommand.exe. Дополнительные сведения: Ссылка на объект не указывает на экземпляр объекта&quot;. Кроме того, несмотря на появление записи, что строка подключения записана, в файле 006_SQLCommand.exe.config строка подключения отсутствует. Помогите, пожалуйста, разобраться.<br>
<span class="b-attach" data-size="3265" data-hits="552" data-attach-id="57734" data-attach-post-id="3755688">
			<span class="b-attach__title"></span><a class='b-attach-link' href='https://forum.sources.ru/index.php?act=Attach&amp;type=post&amp;id=3755688&amp;attach_id=57734' title='Скачать файл' target='_blank'>AppConfig.zip</a> (, : 552)
		</span>]]></description>
        <author>tumanovalex</author>
        <category>.NET: Базы данных</category>
      </item>
	
      </channel>
      </rss>
	