Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > object data source

Thread Tools

object data source

Posts: n/a
I have a grid with an object datasource; selecting and populating the grid
works fine. I want to delete an item in the grid. How can I find out the
value of the parameters that are getting passed to my method? Or how can I
populate these parameters with the correct values? When I debug the method,
there are no values getting passed to it. The datasource and grid are as


<asp:GridView ID="gvProducts" runat="server" AutoGenerateColumns="False"
DataSourceID="oDSProducts" EmptyDataText="No products found">
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
EditImageUrl="~/Images/Edit.gif" DeleteImageUrl="~/Images/trash.gif"
CancelImageUrl="~/Images/undo.gif" SelectImageUrl="~/Images/arrow-right.gif"
UpdateImageUrl="~/Images/Update.gif" ButtonType="Image" SelectText=""
ShowSelectButton="True" />
<asp:TemplateField InsertVisible="False" SortExpression="ID">
<asp:Label ID="Label2" visible="false" runat="server" Text='<%#
Bind("ID") %>'></asp:Label>
<asp:BoundField DataField="ItemNumber" HeaderText="Item Number"
SortExpression="ItemNumber" />
<asp:BoundField DataField="Productname" HeaderText="Product Name"
SortExpression="Productname" />
<asp:BoundField DataField="WholeSalePrice" HeaderText="Wholesale"
SortExpression="WholeSalePrice" DataFormatString="{0:c2}" >
<ItemStyle HorizontalAlign="Right" />
<asp:BoundField DataField="Retailprice" HeaderText="Retail"
SortExpression="Retailprice" DataFormatString="{0:d2}" >
<ItemStyle HorizontalAlign="Right" />

<asp:ObjectDataSource ID="oDSProducts" runat="server"
TypeName="cls.Product" DeleteMethod="DeleteProduct">
<asp:ControlParameter ControlID="gvCategories"
Name="ProductCategoryID" PropertyName="SelectedValue" Type="Int32"
DefaultValue="1" />
<asparameter Name="SectionID" DefaultValue="1" Type="Int32" />
<asparameter Name="ID" />
<asparameter Name="ItemNumber" />

Public Shared Sub DeleteProduct(ByVal ID as String)

Dim _DL as New cls
Dim qry as String = "ProductDelete '" & ID & "'"
Catch ex As Exception
Throw New Exception("Delete Product: " & ex.Message)
End Try

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Object data source, setting parameter source to Page.Partner.Guid Allan Ebdrup ASP .Net Web Controls 2 10-06-2006 10:24 AM
Need some ideas to selectively fetch data via object data source or cache... Siva ASP .Net 1 04-24-2006 08:54 PM
Object Data Source and Custom Business Object =?Utf-8?B?S2h1emVtYQ==?= ASP .Net 0 06-27-2005 07:03 AM
Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software ) Author Tarun Tyagi C Programming 0 12-29-2004 05:10 PM
Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software ) Author Tarun Tyagi Cisco 0 12-29-2004 05:03 PM