OrderGroupSearch Problem !!
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
OrderGroupSearch Problem !!

 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server
Author Message
Ravi Shankar
Guest





Posted: Mon Dec 20, 2004 3:41 pm    Post subject: OrderGroupSearch Problem !! Reply with quote

I need to get a list of off the Orders in the System from a given date so I
did the following

ordergroupsearchoptions.Columns.add("ordergroup_id")
ordergroupsearchoptions.Columns.add("user_id")

ordergroupsearch.startdatetime = new Date(2004, 11, 16, 0, 0 , 0)
ordergroupsearch.enddatetime = now()
datset = ordergroupsearch.search(ordergroupsearchoptions)

Now I get only 20 rows as the result whereas If I run a SQL query on the
OrderGroup table I get 122 records which I verified is correct data... so why
is ordergroupsearch only returning 20 ?

Regards.

--
Ravi Shankar
Back to top
Jason Xu
Guest





Posted: Tue Dec 21, 2004 4:48 am    Post subject: RE: OrderGroupSearch Problem !! Reply with quote

Hi Ravi,

The 20 is the default pagesize. You may want to increase this to a big
value for example 500 and you will see the dataset row number returned
correct.

Below is a piece of code sample (in C#) for you.
***************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Orders;

namespace Microsoft.Solutions.Applications
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearchOptions ogso =
new Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearchOptions();

Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearch ogs = new
Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearch();
ogs.OrderContext = CommerceContext.Current.OrderSystem;

ogso.Columns.Add("ordergroup_id");
ogso.Columns.Add("user_id");
ogso.PageSize=500;

ogs.StartDateTime = new DateTime(2004, 11, 16, 0, 0, 0);
ogs.EndDateTime = DateTime.Now;
System.Data.DataSet da = ogs.Search(ogso);
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}
***************************************

Thanks,
Jason

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
--------------------
Thread-Topic: OrderGroupSearch Problem !!
thread-index: AcTmeAVl04c42DrxQtaUYQpMjcmjQw==
X-WBNR-Posting-Host: 15.219.201.70
From: =?Utf-8?B?UmF2aSBTaGFua2Fy?= <shankycheil@newsgroup.nospam>
Subject: OrderGroupSearch Problem !!
Date: Mon, 20 Dec 2004 01:41:03 -0800
Lines: 18
Message-ID: <6CFB43BA-C14C-41BF-89EA-2253F8E0315D@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15271
X-Tomcat-NG: microsoft.public.commerceserver.general

I need to get a list of off the Orders in the System from a given date so I
did the following

ordergroupsearchoptions.Columns.add("ordergroup_id")
ordergroupsearchoptions.Columns.add("user_id")

ordergroupsearch.startdatetime = new Date(2004, 11, 16, 0, 0 , 0)
ordergroupsearch.enddatetime = now()
datset = ordergroupsearch.search(ordergroupsearchoptions)

Now I get only 20 rows as the result whereas If I run a SQL query on the
OrderGroup table I get 122 records which I verified is correct data... so
why
is ordergroupsearch only returning 20 ?

Regards.

--
Ravi Shankar
Back to top
Ravi Shankar
Guest





Posted: Thu Dec 23, 2004 11:35 am    Post subject: RE: OrderGroupSearch Problem !! Reply with quote

Thanks Jason, that has solved my problem. It would help is this is documented
are part of the OrderGroupSearch Object. I assumes (wrongly) that pagesize is
something you'd use if you want the results paginated and not associate it
with the number of rows retuned by default.

Regards.

"Jason Xu" wrote:

Quote:
Hi Ravi,

The 20 is the default pagesize. You may want to increase this to a big
value for example 500 and you will see the dataset row number returned
correct.

Below is a piece of code sample (in C#) for you.
***************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Orders;

namespace Microsoft.Solutions.Applications
{
/// <summary
/// Summary description for WebForm1.
/// </summary
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearchOptions ogso =
new Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearchOptions();

Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearch ogs = new
Microsoft.CommerceServer.Runtime.Orders.OrderGroupSearch();
ogs.OrderContext = CommerceContext.Current.OrderSystem;

ogso.Columns.Add("ordergroup_id");
ogso.Columns.Add("user_id");
ogso.PageSize=500;

ogs.StartDateTime = new DateTime(2004, 11, 16, 0, 0, 0);
ogs.EndDateTime = DateTime.Now;
System.Data.DataSet da = ogs.Search(ogso);
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}
***************************************

Thanks,
Jason

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
--------------------
Thread-Topic: OrderGroupSearch Problem !!
thread-index: AcTmeAVl04c42DrxQtaUYQpMjcmjQw==
X-WBNR-Posting-Host: 15.219.201.70
From: =?Utf-8?B?UmF2aSBTaGFua2Fy?= <shankycheil@newsgroup.nospam
Subject: OrderGroupSearch Problem !!
Date: Mon, 20 Dec 2004 01:41:03 -0800
Lines: 18
Message-ID: <6CFB43BA-C14C-41BF-89EA-2253F8E0315D@microsoft.com
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15271
X-Tomcat-NG: microsoft.public.commerceserver.general

I need to get a list of off the Orders in the System from a given date so I
did the following

ordergroupsearchoptions.Columns.add("ordergroup_id")
ordergroupsearchoptions.Columns.add("user_id")

ordergroupsearch.startdatetime = new Date(2004, 11, 16, 0, 0 , 0)
ordergroupsearch.enddatetime = now()
datset = ordergroupsearch.search(ordergroupsearchoptions)

Now I get only 20 rows as the result whereas If I run a SQL query on the
OrderGroup table I get 122 records which I verified is correct data... so
why
is ordergroupsearch only returning 20 ?

Regards.

--
Ravi Shankar

Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Commerce Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB