<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Datenbank und Verbindung]]></title><description><![CDATA[<p>Hallo, meine Programmiereien sind schon ein weilchen her und ich habe ein Problem in einem c# Programm, das ich gerade zum üben schreibe.</p>
<p>Ich möchte mich mit einer DB verbinden und etwas hineinschreiben:</p>
<pre><code>//-&gt;
            string sConnectionString = &quot;Data Source=localhost;Initial Catalog=system;User Id=sa;Password=passwort&quot;;
            MessageBox.Show(sConnectionString);
            SqlConnection objConn = new SqlConnection(sConnectionString);
            objConn.Open();
            string sSQL = &quot;INSERT INTO People Vorname VALUES ('test')&quot;;
            SqlCommand objCmd = new SqlCommand(sSQL, objConn);
            try
            {
                objCmd.ExecuteNonQuery();
            }
            catch (System.Exception error)
            {
                MessageBox.Show(error.Message);

            }
            MessageBox.Show(&quot;Daten gespeichert&quot;);
            //-&gt;
</code></pre>
<p>Beim Betätigen des Buttons hängt sich das Programm auf. Nach einer Weile kommt ein Fehler_ Verbindung mit SQL Server konnte nicht hergestellt werden.<br />
Wenn ich im C# auf Testverbindung gehe, sagt mir C# das alles klappt.</p>
<p>Ich wüsstegerne wie ich dem Aufhängen des Progs entgehen könnte und was zum Geier ich in meinem ConnString falsch habe...</p>
<p>Danke für Eure Zeit!</p>
<p>MaPe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/285852/datenbank-und-verbindung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 11:01:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/285852.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Apr 2011 19:14:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datenbank und Verbindung on Thu, 28 Apr 2011 19:14:48 GMT]]></title><description><![CDATA[<p>Hallo, meine Programmiereien sind schon ein weilchen her und ich habe ein Problem in einem c# Programm, das ich gerade zum üben schreibe.</p>
<p>Ich möchte mich mit einer DB verbinden und etwas hineinschreiben:</p>
<pre><code>//-&gt;
            string sConnectionString = &quot;Data Source=localhost;Initial Catalog=system;User Id=sa;Password=passwort&quot;;
            MessageBox.Show(sConnectionString);
            SqlConnection objConn = new SqlConnection(sConnectionString);
            objConn.Open();
            string sSQL = &quot;INSERT INTO People Vorname VALUES ('test')&quot;;
            SqlCommand objCmd = new SqlCommand(sSQL, objConn);
            try
            {
                objCmd.ExecuteNonQuery();
            }
            catch (System.Exception error)
            {
                MessageBox.Show(error.Message);

            }
            MessageBox.Show(&quot;Daten gespeichert&quot;);
            //-&gt;
</code></pre>
<p>Beim Betätigen des Buttons hängt sich das Programm auf. Nach einer Weile kommt ein Fehler_ Verbindung mit SQL Server konnte nicht hergestellt werden.<br />
Wenn ich im C# auf Testverbindung gehe, sagt mir C# das alles klappt.</p>
<p>Ich wüsstegerne wie ich dem Aufhängen des Progs entgehen könnte und was zum Geier ich in meinem ConnString falsch habe...</p>
<p>Danke für Eure Zeit!</p>
<p>MaPe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2055730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2055730</guid><dc:creator><![CDATA[MaPeGr]]></dc:creator><pubDate>Thu, 28 Apr 2011 19:14:48 GMT</pubDate></item><item><title><![CDATA[Reply to Datenbank und Verbindung on Fri, 29 Apr 2011 00:08:32 GMT]]></title><description><![CDATA[<p>Hallo MaPeGr,</p>
<p>Es wäre interessant zu wissen welche DB du benutzt (SQLServer 2005, SQL Server 2008, Oracle, MySQL).<br />
Sollte es der Fall sein, dass du SQL Server Express Versionen benutzt, so musst du in deinem connection string &quot;localhost&quot; ersetzen durch &quot;localhost\SQLEXPRESS&quot;.</p>
<p>mfg evilplayground</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2055846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2055846</guid><dc:creator><![CDATA[evilplayground]]></dc:creator><pubDate>Fri, 29 Apr 2011 00:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to Datenbank und Verbindung on Fri, 29 Apr 2011 11:27:07 GMT]]></title><description><![CDATA[<p>Unter <a href="http://www.connectionstrings.com" rel="nofollow">www.connectionstrings.com</a> kannst du dir den passenden ConnectionString für deine DB raussuchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2056021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2056021</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Fri, 29 Apr 2011 11:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to Datenbank und Verbindung on Sat, 30 Apr 2011 07:19:12 GMT]]></title><description><![CDATA[<p>Dankesehr das hat geholfen. Verbindung zu MsSQL steht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2056352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2056352</guid><dc:creator><![CDATA[MaPeGr]]></dc:creator><pubDate>Sat, 30 Apr 2011 07:19:12 GMT</pubDate></item></channel></rss>