<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</title>
		<link>http://p2p.wrox.com</link>
		<description>This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 Read more about ASP.NET 2.0 Instant Results  or buy the book from your favorite retailerDownload the code for ASP.NET 2.0 Instant Results Buy chapters from this book in PDF</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 20:59:16 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>deleting items from physical folder</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/77116-deleting-items-physical-folder.html</link>
			<pubDate>Sat, 21 Nov 2009 15:56:45 GMT</pubDate>
			<description><![CDATA[Hello sir,
The almost last thing I am struggling with is that I am trying to delete the contents from physical folder. When a "delete" query is fired...]]></description>
			<content:encoded><![CDATA[<div>Hello sir,<br />
The almost last thing I am struggling with is that I am trying to delete the contents from physical folder. When a &quot;delete&quot; query is fired from any of the data bound controls, it deletes the record from database but leaves out the stuff in physical folder as trash which will never be used again.<br />
I have idea about deleting/renaming files/folders, but I am having problem in getting the exact Id of the file while deleting. I am using FormView. How I get the exact Id of item.<br />
My page is <b>AddDeleteSong.aspx</b> which contains the FormView. How the id of item can be acquired?<br />
I am using following code snippet.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Private con As New SqlConnection(&quot;server=.\SqlExpress;AttachDbFileName=|DataDirectory|Gallery.mdf;Integrated Security=True;User Instance=True&quot;)<br />
Private fileNamePath As String</code><hr />
</div>Then files are being uploaded properly(except files are duplicated in the physical folder)<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Protected Sub FormView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting<br />
&nbsp; &nbsp; &nbsp; &nbsp; Try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim theFileUpload As FileUpload = CType( _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FormView1.FindControl(&quot;FileUpload1&quot;), FileUpload)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If theFileUpload.HasFile Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileNamePath = &quot;~/Music/&quot; &amp; Guid.NewGuid.ToString()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim theExtension As String = Path.GetExtension(theFileUpload.FileName)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fileNamePath &amp;= theExtension<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; theFileUpload.SaveAs(Server.MapPath(fileNamePath))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.Values(&quot;SongPath&quot;) = fileNamePath<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.Values(&quot;SongExtn&quot;) = theExtension<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; Catch ex As Exception<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Throw<br />
&nbsp; &nbsp; &nbsp; &nbsp; End Try<br />
&nbsp; &nbsp; End Sub</code><hr />
</div>deleting file is as follows.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Protected Sub FormView1_ItemDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewDeleteEventArgs) Handles FormView1.ItemDeleting<br />
&nbsp; &nbsp; &nbsp; &nbsp; con.Open()<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim musicId As Integer = Convert.ToInt32(Request.QueryString.Get(&quot;Id&quot;))<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim filePath As String = &quot;select SongPath from Music where Id = &quot; &amp; musicId<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim cmd As New SqlCommand(filePath, con)<br />
&nbsp; &nbsp; &nbsp; &nbsp; cmd.ExecuteNonQuery()<br />
&nbsp; &nbsp; &nbsp; &nbsp; File.Delete(filePath)<br />
&nbsp; &nbsp; &nbsp; &nbsp; con.Close()<br />
&nbsp; &nbsp; End Sub</code><hr />
</div><b>musicId</b> can be acquired by query string but where I use this query string and how.<br />
Is there any thing wrong with the deleting code. Can you please guide me regarding this, where I should modify the <b>FormView1_ItemDeleting</b></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/77116-deleting-items-physical-folder.html</guid>
		</item>
		<item>
			<title>Multiple category for a product.</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76959-multiple-category-product.html</link>
			<pubDate>Mon, 09 Nov 2009 04:59:53 GMT</pubDate>
			<description>how can i assign multiple category for a products when adding products as an admin .</description>
			<content:encoded><![CDATA[<div>how can i assign multiple category for a products when adding products as an admin .</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>ashwinirajp</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76959-multiple-category-product.html</guid>
		</item>
		<item>
			<title>updating items in form view</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76882-updating-items-form-view.html</link>
			<pubDate>Tue, 03 Nov 2009 17:14:01 GMT</pubDate>
			<description>Hello friends,
Can any one tell about how to update items using form view.
I am working on webshop. And having problem while updating item in...</description>
			<content:encoded><![CDATA[<div>Hello friends,<br />
Can any one tell about how to update items using form view.<br />
I am working on webshop. And having problem while updating item in addproduct.aspx <br />
Can any body  tell how to get the product updated. Will I have to write the function as for item inserting and item deleting in ShopManagerDB.<br />
Please help me regarding this. I am not able to solve it on my own. I have tried it so much and also used different contol DetailsView , but nothing seems useful.<br />
So any kind of help is most appreciated.........</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76882-updating-items-form-view.html</guid>
		</item>
		<item>
			<title>Video gallery</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76836-video-gallery.html</link>
			<pubDate>Sat, 31 Oct 2009 15:31:30 GMT</pubDate>
			<description>Hi Imar...

I want to have a video gallery in my site....
Manager should be able to upload video files....
And, anyone should be able to view the...</description>
			<content:encoded><![CDATA[<div>Hi Imar...<br />
<br />
I want to have a video gallery in my site....<br />
Manager should be able to upload video files....<br />
And, anyone should be able to view the video in the site...<br />
I want the video to be displayed inside the webpage itself....<br />
Along with the options of pause, stop, play and volume control...<br />
<br />
Please can you guide me, about doing this...<br />
Please will you give me a general idea as well as important things which should be taken care of....<br />
<br />
Thanking you a lot...<br />
Thanks again...</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>varunbwj</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76836-video-gallery.html</guid>
		</item>
		<item>
			<title>using dropdown list</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76835-using-dropdown-list.html</link>
			<pubDate>Sat, 31 Oct 2009 14:22:08 GMT</pubDate>
			<description>Hello Sir, *thank you for replies on form view.* I am working on it.
But I have one another query that I wanna use dropdown list instead of repeater....</description>
			<content:encoded><![CDATA[<div>Hello Sir, <b>thank you for replies on form view.</b> I am working on it.<br />
But I have one another query that I wanna use dropdown list instead of repeater. I have used dropdown list and bound it to the objectdata source like <br />
 <div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;asp:DropDownList ID=&quot;lstCategoryId&quot; runat=&quot;server&quot; AutoPostBack=&quot;True&quot; DataSourceID=&quot;ObjectDataSource1&quot;<br />
&nbsp;DataTextField=&quot;Description&quot; DataValueField=&quot;Id&quot; AppendDataBoundItems=&quot;True&quot;&gt;<br />
&nbsp; &lt;asp:ListItem Value=&quot;&quot;&gt;Please Choose Category&lt;/asp:ListItem&gt;<br />
&nbsp; &lt;/asp:DropDownList&gt;</code><hr />
</div>And I wanna bound it with datalist control, so that whenever I choose any category from dropdown list then only corresponding items of particular items are filled in data list.<br />
Any suggestion is most appreciated......<br />
Or is there any other control where I can use dropdown list with other control providing same functionality as with datalist.<br />
<b>Thank you......</b></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76835-using-dropdown-list.html</guid>
		</item>
		<item>
			<title>Updating items in form view</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76830-updating-items-form-view.html</link>
			<pubDate>Fri, 30 Oct 2009 18:51:46 GMT</pubDate>
			<description>Thank you sir for last post. That really helped me out.
But as problems never end, I have another problem. Well not used in book but I wanna add...</description>
			<content:encoded><![CDATA[<div>Thank you sir for last post. That really helped me out.<br />
But as problems never end, I have another problem. Well not used in book but I wanna add functionality of updating products in AddProduct.aspx file.<br />
I have used Edit Item Template with Form view and added events like <br />
 <b>OnItemInserting = &quot;FormView1_ItemInserting&quot; OnItemUpdating= &quot;FormView1_ItemUpdating&quot; <br />
 OnItemInserted = &quot;FormView1_ItemInserted&quot; OnItemUpdated = &quot;FormView1_ItemUpdated&quot;</b><br />
AddProduct.aspx page looks like <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;asp:FormView ID=&quot;FormView1&quot; runat=&quot;server&quot; DataSourceID=&quot;odsProducts&quot; DefaultMode=&quot;Insert&quot; DataKeyNames = &quot;Id&quot; <br />
&nbsp;OnItemInserting = &quot;FormView1_ItemInserting&quot; OnItemUpdating= &quot;FormView1_ItemUpdating&quot; <br />
&nbsp;OnItemInserted = &quot;FormView1_ItemInserted&quot; OnItemUpdated = &quot;FormView1_ItemUpdated&quot; &gt;<br />
&nbsp; &nbsp; <b>&lt;EditItemTemplate &gt;<br />
&nbsp; &nbsp; &lt;h1&gt;Update The Product&lt;/h1&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;table border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;width: 100%; height: 100%&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;Label&quot; valign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Title:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:TextBox ID=&quot;TitleTextBox&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Title&quot;) %&gt;' Width=&quot;300px&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;TitleTextBox&quot; ErrorMessage=&quot;Please Enter A Title&quot; Display=&quot;Dynamic&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;Label&quot; valign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Description:&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:TextBox ID=&quot;DescriptionTextBox&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Description&quot;) %&gt;' TextMode=&quot;MultiLine&quot; Width=&quot;300px&quot; Height=&quot;106px&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator2&quot; runat=&quot;server&quot; ControlToValidate=&quot;DescriptionTextBox&quot; ErrorMessage=&quot;Please Enter A Description&quot; Display=&quot;Dynamic&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;Label&quot; valign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Category:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:DropDownList ID=&quot;lstCategoryId&quot; runat=&quot;server&quot; DataSourceID=&quot;odsProductCategories&quot; DataTextField=&quot;Description&quot; DataValueField=&quot;Id&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/asp:DropDownList&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;Label&quot; valign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Price:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:TextBox ID=&quot;PriceTextBox&quot; runat=&quot;server&quot; Text='&lt;%# Bind(&quot;Price&quot;) %&gt;' Width=&quot;300px&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator3&quot; runat=&quot;server&quot; ControlToValidate=&quot;PriceTextBox&quot; ErrorMessage=&quot;Please Enter The Price&quot; Display=&quot;Dynamic&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;asp:RangeValidator ID=&quot;RangeValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;PriceTextBox&quot; ErrorMessage=&quot;Please Enter A Number Between 0 And 10000&quot; MaximumValue=&quot;10000&quot; MinimumValue=&quot;0&quot; Type=&quot;Currency&quot; Display=&quot;Dynamic&quot;&gt;&lt;/asp:RangeValidator&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&quot;Label&quot; valign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Image:&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:FileUpload ID=&quot;FileUpload1&quot; runat=&quot;server&quot; Width=&quot;300px&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator4&quot; runat=&quot;server&quot; ControlToValidate=&quot;FileUpload1&quot; Display=&quot;Dynamic&quot; ErrorMessage=&quot;Please Select An Image First&quot;&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;nbsp;&lt;asp:Button ID=&quot;btnInsert&quot; runat=&quot;server&quot; CommandName=&quot;Insert&quot; Text=&quot;Insert&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;asp:Button ID=&quot;btnCancel&quot; runat=&quot;server&quot; CommandName=&quot;Cancel&quot; Text=&quot;Cancel&quot; CausesValidation=&quot;False&quot; OnClick=&quot;btnCancel_Click&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;/table&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;br /&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;br /&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;br /&gt;<br />
&nbsp; &nbsp; &nbsp; &amp;nbsp;&lt;br /&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;br /&gt;<br />
&nbsp; &nbsp; &nbsp; &amp;nbsp;<br />
&nbsp; &nbsp; &lt;/EditItemTemplate&gt;<br />
</b>&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;InsertItemTemplate&gt;<br />
Same implementation as in book.....<br />
&nbsp;&lt;/InsertItemTemplate&gt;<br />
&lt;/asp:FormView&gt;</code><hr />
</div>I have changed the corresponding object data source as <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&lt;asp:ObjectDataSource ID=&quot;odsProducts&quot; runat=&quot;server&quot; DataObjectTypeName=&quot;Product&quot; InsertMethod=&quot;InsertProduct&quot; SelectMethod=&quot;GetProduct&quot; <b><i>UpdateMethod=&quot;UpdateProduct&quot;</i></b>&nbsp; TypeName=&quot;ShopManager&quot;&gt;</code><hr />
</div>Also added update method in the ShopManagerDB.<acronym title="vBulletin">vb</acronym> and called it from ShopManager.<acronym title="vBulletin">vb</acronym><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left"> Public Shared Sub UpdateProduct(ByVal theProduct As Product)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Try<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Using myConnection As New SqlConnection(AppConfiguration.ConnectionString)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dim myCommand As SqlCommand = New SqlCommand(&quot;sprocProductInsertUpdateSingleItem&quot;, myConnection)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.CommandType = CommandType.StoredProcedure<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <b> myCommand.Parameters.Clear()</b><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@title&quot;, theProduct.Title)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@description&quot;, theProduct.Description)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@price&quot;, theProduct.Price)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@categoryId&quot;, theProduct.CategoryId)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@pictureUrlSmall&quot;, theProduct.PictureUrlSmall)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@pictureUrlMedium&quot;, theProduct.PictureUrlMedium)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@pictureUrlLarge&quot;, theProduct.PictureUrlLarge)<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myConnection.Open()<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.ExecuteNonQuery()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myConnection.Close()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End Using<br />
&nbsp; &nbsp; &nbsp; &nbsp; Catch ex As Exception<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' Pass up the error; it will be caught by the code in the Global.asax and the generic error page set up in web.config.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Throw<br />
&nbsp; &nbsp; &nbsp; &nbsp; End Try<br />
&nbsp; &nbsp; End Sub</code><hr />
</div>But rather than updating item it inserts item in the database. For this purpose I had removed <div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">If theProduct.Id = -1 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@id&quot;, DBNull.Value)<br />
&nbsp; &nbsp; &nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myCommand.Parameters.AddWithValue(&quot;@id&quot;, theProduct.Id)<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If</code><hr />
</div>And used <b>myCommand.Parameters.Clear() </b> to get rid off previous value but still it is not working.....<br />
please help me in this regard.......<br />
<b>And yeah once again thank you for last post</b></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76830-updating-items-form-view.html</guid>
		</item>
		<item>
			<title>using create user wizard</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76818-using-create-user-wizard.html</link>
			<pubDate>Thu, 29 Oct 2009 21:37:04 GMT</pubDate>
			<description>Hello Imar sir,
Well everything is going well till now. But the other thing that I am trying to look for is that Is there any way to determine that a...</description>
			<content:encoded><![CDATA[<div>Hello Imar sir,<br />
Well everything is going well till now. But the other thing that I am trying to look for is that Is there any way to determine that a user already exist or not, without full post back of the page?<br />
That is as soon as we enter the user name it warns immediately if it exists already. I am using <acronym title="vBulletin">VB</acronym>.NET . One solution that I think of is using web service, if I am right. So can you please tell the exact way or give some suggestion regarding this. Any help is appreciated.<br />
Thank you..............</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76818-using-create-user-wizard.html</guid>
		</item>
		<item>
			<title>instant results chapter 7</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76762-instant-results-chapter-7-a.html</link>
			<pubDate>Mon, 26 Oct 2009 12:28:21 GMT</pubDate>
			<description><![CDATA[I try to add photo I get this
Could not find a part of the path 'C:\wwwroot\WebSite7\upload\new.jpg'.
 
can someone help me?]]></description>
			<content:encoded><![CDATA[<div>I try to add photo I get this<br />
<i>Could not find a part of the path 'C:\wwwroot\WebSite7\upload\new.jpg'.</i><br />
 <br />
<i>can someone help me?</i></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>pauljames</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76762-instant-results-chapter-7-a.html</guid>
		</item>
		<item>
			<title>editing with form view...........</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76740-editing-form-view.html</link>
			<pubDate>Sat, 24 Oct 2009 02:33:51 GMT</pubDate>
			<description>hello sir, how are you.
Well emailing is on the fly. I am able to send emails to both (admin and user)
But one thing that I came across while working...</description>
			<content:encoded><![CDATA[<div>hello sir, how are you.<br />
Well emailing is on the fly. I am able to send emails to both (admin and user)<br />
But one thing that I came across while working on application is price symbol.<br />
Can you please specify the page no. for formatting price symbol and also for editing in form view. I am having some problem in looking for these two in book.<br />
Thank you for email suggestion.............</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>sophia</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76740-editing-form-view.html</guid>
		</item>
		<item>
			<title>Code for Chpt.2-Wrox File Share is missing Default.aspx and Default.aspx.vb</title>
			<link>http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76732-code-chpt-2-wrox-file-share-missing-default-aspx-default-aspx-vbulletin.html</link>
			<pubDate>Fri, 23 Oct 2009 17:03:32 GMT</pubDate>
			<description><![CDATA[I tried to implement the Wrox File Share from chapter 2, following the "Local Developer Installation" by opening Visual Studio 2008, starting a New...]]></description>
			<content:encoded><![CDATA[<div>I tried to implement the Wrox File Share from chapter 2, following the &quot;Local Developer Installation&quot; by opening Visual Studio 2008, starting a New Web Site, then copying in the files from the CD. I used the code from the Modifications folder. Then I modified the web.config as instructed in the book.<br />
 <br />
When I ranthe web app, I was greeted with a blank screen. This is reflecting the empty Default.aspx which is generated when a New web site is started in Visual Studio. There is not a Default.aspx file nor a Default.aspx.<acronym title="vBulletin">vb</acronym> file included with the code I copied from the CD. I checked the code in the Source folder and also downloaded the code from this web site to locate copies of the missing files, but did not find them anywhere.<br />
 <br />
In absence of these files, I typed in the code from the book for the Page_Preinit into the empty Default.aspx.<acronym title="vBulletin">vb</acronym>. There was no code indicated in the book showing what is supposed to be in the Default.aspx file <br />
 <br />
Where can I find the code which belongs in the Default.aspx file and the Default.aspx.<acronym title="vBulletin">vb</acronym> file?</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6-252/">BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6</category>
			<dc:creator>bzoni</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/book-asp-net-2-0-instant-results-isbn-978-0-471-74951-6/76732-code-chpt-2-wrox-file-share-missing-default-aspx-default-aspx-vbulletin.html</guid>
		</item>
	</channel>
</rss>
