<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/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>MySQL</title><link>http://forums.asp.net/56.aspx</link><description>Discuss using MySQL as a data store for ASP.NET.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: how to update columes in the mysql using C#.net</title><link>http://forums.asp.net/thread/2603383.aspx</link><pubDate>Fri, 05 Sep 2008 16:43:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2603383</guid><dc:creator>Karrar666</dc:creator><author>Karrar666</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2603383.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=56&amp;PostID=2603383</wfw:commentRss><description>&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt; usernameParameter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;?username&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlDbType&lt;/font&gt;&lt;font size="2"&gt;.VarChar, 150); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;// You can use string patameter&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;usernameParameter.Value = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt;)Session[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;username&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;]; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;cmd.Parameter.Add(usernameParameter);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt; seekingParameter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;?seeking&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlDbType&lt;/font&gt;&lt;font size="2"&gt;.Int32, 0); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;// You can use Integer Patameter&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;seekingParameter.Value = ddlseek.Text;&lt;/p&gt;
&lt;p&gt;cmd.Parameter.Add(seekingParameter);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt; agefromParameter = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlParameter&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;?agefrom&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlDbType&lt;/font&gt;&lt;font size="2"&gt;.Date, 0); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;// You can use date Patameter&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;agefromParameter.Value = ddlfrom.Text;&lt;/p&gt;
&lt;p&gt;cmd.Parameter.Add(agefromParameter);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SQL = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot; UPDATE tbl_users SET seeking = ?seeking, agefrom = ?agefrom Where username = ?username&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlCommand&lt;/font&gt;&lt;font size="2"&gt; cmd = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MySqlCommand&lt;/font&gt;&lt;font size="2"&gt;(SQL, conn); &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;conn.Open();&lt;/p&gt;
&lt;p&gt;cmd.ExecuteNonQuery();&lt;/p&gt;
&lt;p&gt;conn.Close();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;Always use Paramters Coz is protected against SQL injection and easy to debug ;) &lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: how to update columes in the mysql using C#.net</title><link>http://forums.asp.net/thread/2589036.aspx</link><pubDate>Fri, 29 Aug 2008 14:16:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2589036</guid><dc:creator>bullpit</dc:creator><author>bullpit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2589036.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=56&amp;PostID=2589036</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;krishnakumari:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;&lt;font size="2"&gt;+&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;where username=&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t have a space before &amp;quot;where&amp;quot;. Insert a space like this: &amp;quot; where &amp;quot;&lt;/p&gt;</description></item><item><title>Re: how to update columes in the mysql using C#.net</title><link>http://forums.asp.net/thread/2588983.aspx</link><pubDate>Fri, 29 Aug 2008 13:59:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2588983</guid><dc:creator>krishnakumari</dc:creator><author>krishnakumari</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2588983.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=56&amp;PostID=2588983</wfw:commentRss><description>&lt;p&gt;I tried with this&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; un = (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt;)Session[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;username&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; str1 = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;@&amp;quot;update tbl_users set seeking=&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ddlseek.Text +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; ,agefrom=&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ddlfrom.Text + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;,ageto=&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ddlto.Text +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;where username=&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; str2 = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;#39;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + un + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;&amp;#39;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; str = str1 + str2;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;MySqlCommand&lt;/font&gt;&lt;font size="2"&gt; cmd = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#008080" size="2"&gt;MySqlCommand&lt;/font&gt;&lt;font size="2"&gt;(str, conn);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;conn.Open();&lt;/p&gt;
&lt;p&gt;cmd.ExecuteNonQuery();&lt;/p&gt;
&lt;p&gt;conn.Close();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Error Message:&lt;/p&gt;
&lt;p&gt;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &amp;#39;username=&amp;#39;user1&amp;#39;&amp;#39; at line 1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But with the same srting I tried with the mysqlcmd, It&amp;#39;s working.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;please help me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: how to update columes in the mysql using C#.net</title><link>http://forums.asp.net/thread/2588936.aspx</link><pubDate>Fri, 29 Aug 2008 13:41:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2588936</guid><dc:creator>bullpit</dc:creator><author>bullpit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2588936.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=56&amp;PostID=2588936</wfw:commentRss><description>&lt;p&gt;It should be same. What have you tried?&lt;/p&gt;</description></item><item><title>how to update columes in the mysql using C#.net</title><link>http://forums.asp.net/thread/2588920.aspx</link><pubDate>Fri, 29 Aug 2008 13:36:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2588920</guid><dc:creator>krishnakumari</dc:creator><author>krishnakumari</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2588920.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=56&amp;PostID=2588920</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;in my application I have update the columes . But that is in mysql databse.&lt;/p&gt;&lt;p&gt;I tried with normal sql query.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is it same as sql server 2005 or is their any diiff.&lt;/p&gt;&lt;p&gt;please help me.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;very urgent &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>