Wrox Programmer Forums
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 3rd, 2004, 03:59 PM
Authorized User
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default E-Comm Product Catalog Search

I'm trying to do a different method of searching a catalog
and producing a dataList. Instead of clicking departments
or categories and getting autopostback, I want to have two
(or more) dropdownlists to choose parameters, then begin
a search by clicking a search button. So autopostback on
the dropdownlists is set to "False".

My page loads, shows the populated ddl's, and I have the
initial dataList set to visible=False(don't want to show
all items before a search is initiated.

My problem is with the search_click sub. Here it is:

Protected Sub Search_Click(ByVal Sender As Object, ByVal E As

            Dim ProductId As Integer
            Dim ProdClassId As String = Request.Params("ProdClassId")
            Dim PropReqCode As String = Request.Params("PropReqCode")

            If Not (ProdClassId) Is Nothing Then

                ClassDropDown.SelectedIndex =
                ClassDropDown.Items.IndexOf( _

            End If

            If Not (PropReqCode) Is Nothing Then
                PropertyRequirementDropDown.SelectedIndex =
                PropertyRequirementDropDown.Items.IndexOf( _

            End If

            Dim CatalogListingsDataSet As DataSet = New _
            CatalogListings.DataSource = CatalogListingsDataSet

            CatalogListings.Visible = True

        End Sub

...right now, this gives me this error message:


An unexpected error has occurred on this page.The system administrators have been notified.

The error occurred in:


Error Message:

Procedure or function sp_Vendors_GetProducts has too many arguments specified.

Error Stack:

System.Data.SqlClient.SqlException: Procedure or function sp_Vendors_GetProducts has too many arguments specified.

   at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior)
   at System.Data.SqlClient.SqlCommand.System.Data.IDbCo mmand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
   at FYRM.WebModules.Data.DbObject.RunProcedure(String storedProcName, IDataParameter[] parameters, String tableName) in C:\FYRM\VendorScape\Webmodules\Core\DbObject.vb:li ne 103
   at FYRM.WebModules.Vendors.Data.ProductCatalog.GetPro ducts(Int32 ProductId, String ProductName, String ProductDescription, Int32 ProdClassId, String VendorCompanyName, String ImageUrl, Int32 PropReqCode, String ContactInfo) in C:\FYRM\VendorScape\WebModules\Vendors\Vendors.Dat a\ProductCatalog.vb:line 66
   at FYRM.WebModules.Vendors.Business.ProductCatalog.Ge tProducts(Int32 ProdClassId, Int32 PropReqCode) in C:\FYRM\VendorScape\WebModules\Vendors\Vendors.Bus iness\ProductCatalog.vb:line 68
   at FYRM.WebModules.Vendors.Web.ProductCatalog.Search_ Click(Object Sender, EventArgs E) in C:\FYRM\VendorScape\WebModules\Vendors\ProductCata log.aspx.vb:line 77
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
   at System.Web.UI.Page.ProcessRequestMain()

Here is the stored proc:

ALTER PROCEDURE sp_Vendors_GetProducts
@ProdClassId Int,
@PropReqCode Int
SELECT ProductId, ProductName, ProductDescription, ProdClassId, VendorCompanyName, ImageUrl, PropReqCode, ContactInfo FROM Vendors_ProductsTable WHERE ProdClassId = @ProdClassId AND PropReqCode = @PropReqCode

- - - - - - - - -
if anyone can see where I might alter this code to fix it, plz
let me know. I have looked around forums and sites for an example
of a button to handle multiple dropdownlist controls, but can't
find one. almost all examples of catalog searches feature drop-
downlists that each do autopostback.

Reid C.
Reid C.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making serial comm work with SerialPort GMan Visual Basic 2008 Essentials 3 March 7th, 2008 05:32 AM
Problem while reading data from COMM Port salman .NET Framework 2.0 0 November 21st, 2007 07:33 AM
Product Search ASP.NET (C#) with MS Access ayazhoda ASP.NET 2.0 Basics 3 April 5th, 2007 10:15 AM
Stop listening to Comm Port life_s Ng ASP.NET 2.0 Basics 3 October 21st, 2006 05:04 AM
C++ Serial I/O Comm Library CNewbie C++ Programming 1 November 25th, 2004 02:59 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.