The Search Product in the Web Combo very slow,

6 replies. Last post: February 18, 2014 5:52 AM by Hans Kristian
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
armore1972Member

Hi to all,

We use the WebCombo for the search products in you system.

The behavior of the Combo is the following:

-You must enter at least four char and after if you press Enter the Search Price is starting.

In this way, the search product seems working very fast.

However, when the product search is running if you insert other char in the combo to reduce the number of the product to search the Search Product becomes slow.

For Example:

-Insert 0046 after press enter the combo was open the return some products

-After digit space space 12 space space 092 …. The result of the combo became slow (instead should be fast because the number of the products to find must be less than before)

Seems that every time that we digit a char the Combo make a Request calling procedure, but after I digit another char another Request was calling and the previous Request was delete but seem the previous calling procedure was not delete and running in background (this should cause of the slowing).

Do you have a tip or advice to reduce this behavior?


The WebCombo was defined in the following .aspx

<ISWebGrid:WebGridColumn Caption="Product" DataMember="productid" Name="productid" SortKeyField= "productnumber"

Width="190px" EditType="WebComboNET"WebComboID="WebComboProd"InputRequired="True"

InputRequiredErrorText="Specify the Product." TreatMarkupAsLiteralText="True"

ColumnType="Custom">

….

<ISWebCombo:WebCombo ID="WebComboProd" runat="server" AdditionalSearchFields="ProductName, Speedy_CustProdRefDescription"

DataTextField="ProductNumber"

DataValueField="ProductId"MinCharsToRequest="2"Height="20px"

UseDefaultStyle="True"OnInitializeRow="WebComboProd_InitializeRow"

Width="550px"Latency="200"

OnInitializeDataSource="WebComboProd_InitializeDataSource"

OnInitializeLayout="WebComboProd_InitializeLayout" AllowWildCardSearch="True"

DropDownRows="7" >

<Columns>

<ISWebCombo:WebComboColumn BaseFieldName="productnumber"Name="productnumber"HeaderText="Number"

Width="150"/>

<ISWebCombo:WebComboColumn BaseFieldName="productname"Name="productname"HeaderText="Name"

Width="250"/>

<ISWebCombo:WebComboColumn BaseFieldName="productid"Name="productid"Hidden="true"

RenderOnHidden="true"/>

<ISWebCombo:WebComboColumn BaseFieldName="Quantity"Name="Quantity"Hidden="true"

RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingPrice"Hidden="True"

Name="Speedy_MinimumSellingPrice"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingQuantity"Hidden="True"

Name="Speedy_MinimumSellingQuantity"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_CustProdRefDescription"Name="Speedy_CustProdRefDescription"

HeaderText="Customer reference" Width="150" />

<ISWebCombo:WebComboColumn BaseFieldName="canModifyCustProdRef"DataType="System.Boolean"

Name="canModifyCustProdRef"RenderOnHidden="True"Hidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="StateCode"

Name="StateCode"RenderOnHidden="True"Hidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_referenceallowed"Name="speedy_referenceallowed"

HeaderText="ReferenceAllowed"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_directdelivery"Name="speedy_directdelivery"

HeaderText="DirectDelivery"Width="120"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="statuscodename"Name="statuscodename"HeaderText="StatusCode"Width="120"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_special"Name="speedy_special"

HeaderText="special"Width="120"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_prodgroupdes"Name="speedy_prodgroupdes"

HeaderText="speedy_productgroupdes c" Width="120"/>

<ISWebCombo:WebComboColumn HeaderText="Url"BaseFieldName="speedy_urltds"Name="speedy_urltds"Hidden="true"

RenderOnHidden="true">

</ISWebCombo:WebComboColumn>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_canreference"Name="speedy_canreference"

HeaderText="CanReference"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_check_prodgroup" Name="speedy_check_prodgroup"

HeaderText="CheckProdGroup"Hidden="true"RenderOnHidden="True"/>

</Columns>

<FlyPostBackSettingsPostControlState="False"PostViewState="False"/>

<LayoutSettings ResultBoxWindowType="Normal"ComboMode="MultipleColumns"EntryMode="AutoComplete"LoadMoreKeyGesture="DownArrowKey"

>

<ClientSideEventsOnAfterItemSelected="WebComboProd_OnAfterItemSelected" OnShowDropDown= "WebComboProd_OnShowDropDown"OnHideDropDown ="WebComboProd_OnHideDropDown"

OnAfterResponseProcess="WebComboProd_OnAfterResponseProcess" />

</LayoutSettings>

</ISWebCombo:WebCombo>

The datasource was also defined

<ISWebCombo:WebCombo ID="WebComboProd" runat="server" AdditionalSearchFields="ProductName, Speedy_CustProdRefDescription"

DataTextField="ProductNumber"

DataValueField="ProductId"MinCharsToRequest="2"Height="20px"

UseDefaultStyle="True"OnInitializeRow="WebComboProd_InitializeRow"

Width="550px"Latency="200"

OnInitializeDataSource="WebComboProd_InitializeDataSource"

OnInitializeLayout="WebComboProd_InitializeLayout" AllowWildCardSearch="True"

DropDownRows="7" >

<Columns>

<ISWebCombo:WebComboColumn BaseFieldName="productnumber"Name="productnumber"HeaderText="Number"

Width="150"/>

<ISWebCombo:WebComboColumn BaseFieldName="productname"Name="productname"HeaderText="Name"

Width="250"/>

<ISWebCombo:WebComboColumn BaseFieldName="productid"Name="productid"Hidden="true"

RenderOnHidden="true" />

<ISWebCombo:WebComboColumn BaseFieldName="Quantity"Name="Quantity"Hidden="true"

RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingPrice"Hidden="True"

Name="Speedy_MinimumSellingPrice"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_MinimumSellingQuantity"Hidden="True"

Name="Speedy_MinimumSellingQuantity"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="Speedy_CustProdRefDescription"Name="Speedy_CustProdRefDescription"

HeaderText="Customer reference" Width="150" />

<ISWebCombo:WebComboColumn BaseFieldName="canModifyCustProdRef" DataType="System.Boolean"

Name="canModifyCustProdRef"RenderOnHidden="True"Hidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="StateCode"

Name="StateCode"RenderOnHidden="True"Hidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_referenceallowed"Name="speedy_referenceallowed"

HeaderText="ReferenceAllowed"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_directdelivery"Name="speedy_directdelivery"

HeaderText="DirectDelivery"Width="120"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="statuscodename"Name="statuscodename"HeaderText="StatusCode"Width="120"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_special"Name="speedy_special"

HeaderText="special"Width="120"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_prodgroupdes"Name="speedy_prodgroupdes"

HeaderText="speedy_productgroupdes c" Width="120"/>

<ISWebCombo:WebComboColumn HeaderText="Url"BaseFieldName="speedy_urltds"Name="speedy_urltds"Hidden="true"

RenderOnHidden="true">

</ISWebCombo:WebComboColumn>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_canreference"Name="speedy_canreference"

HeaderText="CanReference"Hidden="true"RenderOnHidden="True"/>

<ISWebCombo:WebComboColumn BaseFieldName="speedy_check_prodgroup"Name="speedy_check_prodgroup"

HeaderText="CheckProdGroup"Hidden="true"RenderOnHidden="True"/>

</Columns>

<FlyPostBackSettingsPostControlState="False"PostViewState="False"/>

<LayoutSettings ResultBoxWindowType="Normal"ComboMode="MultipleColumns"EntryMode="AutoComplete"LoadMoreKeyGesture="DownArrowKey"

>

<ClientSideEventsOnAfterItemSelected="WebComboProd_OnAfterItemSelected" OnShowDropDown= "WebComboProd_OnShowDropDown"OnHideDropDown ="WebComboProd_OnHideDropDown"

OnAfterResponseProcess="WebComboProd_OnAfterResponseProcess" />

</LayoutSettings>

The Data source calling a Store procedure was define in the .cs

protected void WebComboProd_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)

{

string appleOrderTypeBehaviour = HiddenApplyOrderTypeBehaviour.Value;

//int orderType = 1;

if (!HiddenEntityType.Value.Equals("salesorder"))

{

appleOrderTypeBehaviour = "false";

}

if (HiddenCustomizedDataSource.Value == "true")

{

DataSet1TableAdapters.pGetproductreferenceTableAdapter prods = new pGetproductreferenceTableAdapter();

orderId = Request.QueryString["id"];

orgname = Request.QueryString["orgname"];

//Request.QueryString["userId"]);

DataSet ds = newDataSet();

string queryText = "";

if (!e.IsFlyDataRequest)

{

if (WebComboProd.Value != "" && WebComboProd.Value != null && WebComboProd.Value != " ")

{

ds.Tables.Add(prods.GetDataById(Request.QueryString["customerid"], Request.QueryString["userlcid"], Request.QueryString["orglcid"], HiddenApplyProductDist.Value, Request.QueryString["userId"], HiddenEnableProdRef.Value, WebComboProd.Value));

e.DataSource = ds;

}

}

else

{

int rowCount = e.RowCount;

if (e.StartRow != 0)

{

rowCount = e.RowCount / 2;

}

int TopRows = e.StartRow + rowCount;

queryText = e.QueryText.Replace("*", "%");

if (!e.QueryText.Contains("*"))

queryText = queryText + "%";

string connectionString = Wuerth.Phoenix.Speedy.PriceSearchPlugin.Properties.Settings.Default.Speedy_ConnectionString;

using (SqlConnection conn = new SqlConnection(connectionString))

{

conn.Open();

using (SqlCommand storedProcCommand = new SqlCommand("p_GetproductreferenceQueryTxt", conn))

{

storedProcCommand.CommandType = CommandType.StoredProcedure;

storedProcCommand.Parameters.AddWithValue("@accountID", Request.QueryString["customerid"]);

storedProcCommand.Parameters.AddWithValue("@languageID", Request.QueryString["userlcid"]);

storedProcCommand.Parameters.AddWithValue("@languageIDOrg", Request.QueryString["orglcid"]);

storedProcCommand.Parameters.AddWithValue("@applyProductDist", HiddenApplyProductDist.Value);

storedProcCommand.Parameters.AddWithValue("@userID", Request.QueryString["userId"]);

storedProcCommand.Parameters.AddWithValue("@enableProdRef", HiddenEnableProdRef.Value);

storedProcCommand.Parameters.AddWithValue("@queryTxt", queryText);

storedProcCommand.Parameters.AddWithValue("@numRowsToGet", TopRows);

storedProcCommand.Parameters.AddWithValue("@applyBehaviour", appleOrderTypeBehaviour);

storedProcCommand.Parameters.AddWithValue("@orderType", orderType);

SqlDataAdapter adapter = newSqlDataAdapter(storedProcCommand);

adapter.Fill(ds, e.StartRow, rowCount, "pGetproductreference");

e.DataSource = ds;

}

If you calling the store procedure p_GetproductreferenceQueryTxt directly in the Data Base the search product seems very fast.

All times are GMT -5. The time now is 6:00 AM.
Previous Next