<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Working with Data</title><link>http://asp.net</link><pubDate>Sat, 04 May 2013 09:55:49 GMT</pubDate><generator>umbraco</generator><description>Comments for Working with Data</description><language>en</language><atom:link href="http://asp.net/rss/comments/38385" rel="self" type="application/rss+xml" /><item><title>Comment Posted by wavemaster</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Sun, 17 Jun 2012 15:26:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015792</guid><description><![CDATA[ <p>UpdateProducts.cshmtl does not actually update the database.  I don&#39;t see why, but it does not work.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/wavemaster.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by patel_sir8</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Sun, 01 Jul 2012 01:51:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015890</guid><description><![CDATA[ <p>Good one..</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/patel_sir8.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by justin_cie2</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Thu, 05 Jul 2012 21:43:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015927</guid><description><![CDATA[ <p>I &#39;ve got exception:</p><p>Compiler Error Message: CS0103: The name &#39;Database&#39; does not exist in the current context.</p><p>but it works after I install webmatrix.webdata.dll</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/justin_cie2.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by anilbabu</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Thu, 02 Aug 2012 06:13:36 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016099</guid><description><![CDATA[ <p>What is URL REDIRECTION?How can i use this concept in my .net?</p><p>my task is i have generated one url like this &quot;<a rel="nofollow" href="http://example.com/" target="_blank">example.com/</a>&quot;</p><p>I am passing one pearameter like &quot;<a rel="nofollow" href="http://example.com/Empno=1" target="_blank">example.com/</a>&quot;</p><p>I want to display Ename in Database table that corresponding &quot;Empno&quot;</p><p>plz Help me Give me one simple example</p><p></p><p>I am new this concepts</p><p>plz Help me send source code to my mailID:mandla.anilbabu@gmail.com</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/anilbabu.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by PrinceMonkey</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Sun, 05 Aug 2012 13:09:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016113</guid><description><![CDATA[ <p>It doesnt update the data as anything entered into the form is ignored. There should be a request.form[&quot;Price&quot;] instead of setting the variables to row.price. This just reads in the data and then writes the same data out again. I&#39;ve been struggling to get money fields to accept input and coded in this example to see how it worked. TURNS OUT IT DOESNT WORK! Not good to see these mistakes from asp.net!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/PrinceMonkey.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by wk</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Sat, 11 Aug 2012 01:07:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016148</guid><description><![CDATA[ <p>Agree with above comments - the webpages2 version of updateproducts.cshtml is missing the code to get the new form values: Name = Request[&quot;Name&quot;]; etc - so doesn&#39;t actually save the edited values unless you&#39;ve added those</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/wk.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Daniel C. Santos</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Thu, 13 Sep 2012 11:51:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016431</guid><description><![CDATA[ <p>WebSecurity not working using MySql DataBase</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Daniel%20C.%20Santos.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mfortress</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Fri, 28 Sep 2012 19:26:28 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016544</guid><description><![CDATA[ <p>Others have already given their answers to fix the issue that stops the UpdateProducts page from actually updating products with the correct data.  I&#39;m new to ASP.net.  So, once I spotted the problem, and figured out how to code the solution, I thought I&#39;d also take the time to post my code changes.</p><p></p><p>It turns out the code is definitely updating the products, but it&#39;s using the exact same data originally stored in the table to update the products every time.  The data is never changed to the new values set by the user.</p><p></p><p>Every time the page loads, whether it&#39;s the original load, or any post after the original load, the variable values are set to the data stored in the Product table, as in:</p><p></p><p>var Name = row.Name; </p><p>var Description = row.Description; </p><p>var Price = row.Price;</p><p></p><p>which is fine for the initial load because you want to load the data stored in the table, and display the data in the form fields.  However, when the user changes a value there is no code to store the changed values in the page.  So, the update execution</p><p></p><p>db.Execute(updateQueryString, Name, Description, Price, ProductId); </p><p></p><p>is simply changing the data in the Product table to the same data loaded in from the table.  The code is allowing the user to change the values, but it isn&#39;t storing the changed values.  So, it&#39;s effectively ignoring the changed values.</p><p></p><p>My solution is to add the 3 lines below that set the variable values, in between the &quot;If&quot; test for posting the page, and the line that defines the updateQueryString variable.</p><p></p><p>if (IsPost &amp;&amp; Validation.IsValid()) {</p><p></p><p>    Name = Request[&quot;Name&quot;];</p><p>    Description = Request[&quot;Description&quot;];</p><p>    Price = Request[&quot;Price&quot;];</p><p></p><p>    var updateQueryString = </p><p></p><p>When the user changes values in the form field, and submits (posts) the form by clicking Update, the values in the form fields are added to the query string before posting the form to the server.  With this change, when the page is posted, and only if all validation checks are passed, then the code sets the values of the 3 variables (Name, Description, and Price) to the values passed in the query string.  Those new values are then used to update the Product table.</p><p></p><p>I really enjoy learning about ASP.net, and I hope this solution helps someone else who&#39;s learning about it, too.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mfortress.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rogabbott</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Tue, 25 Dec 2012 23:01:25 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017067</guid><description><![CDATA[ <p>UpdateProducts.cshmtl does not update the database.  I tried the changes suggested by mfortress but they didn&#39;t work, either.  I tried creating new variables inside the post validation statement for the update query string that read from the form (i.e., var uName = Request.Form[&quot;Name&quot;], etc.), but that didn&#39;t work either.</p><p></p><p>Please review your tutorial and make the changes necessary for your product to work.  Nothing discredits a company more than products that don&#39;t work or instructions that fail.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/rogabbott.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by kwandoa</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Tue, 22 Jan 2013 04:47:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018224</guid><description><![CDATA[ <p>thanx mfortress!! works</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/kwandoa.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by frankeirpt</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Mon, 28 Jan 2013 12:47:14 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018266</guid><description><![CDATA[ <p>Hi.</p><p></p><p>I  am using webmatrix asp.net starter site, and at the present moment i&#39;m having a little setback. This is the problem:</p><p>I have the database, with stored user information (UserId, Email) in table UserProfile, and I want to send an email to the last registered user, but i can&#39;t seem to make it work, because i can&#39;t retrieve the email from the database.</p><p>Can you please help me?</p><p>Thank you.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/frankeirpt.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by afzaal.ahmad.zeeshan</title><link>http://asp.net/web-pages/tutorials/data/5-working-with-data</link><pubDate>Sat, 04 May 2013 09:55:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000019035</guid><description><![CDATA[ <p>Nice, and helpfull! Thanks ASP.NET</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/afzaal.ahmad.zeeshan.jpg?forceidenticon=false&amp;dt=635049342000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>