Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FindRows not working properly

0 views
Skip to first unread message

KBS Tours Development

unread,
Sep 23, 2007, 9:23:53 AM9/23/07
to
Hi All,

I've asked this before but no one believed me and everyone told me that I am
doing something wrong.
But here is the evidence happened on my local development box.

Can someone explain this now?

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Server Error in '/' Application.
Find finds a row based on a Sort order, and no Sort order is specified.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentException: Find finds a row based on a
Sort order, and no Sort order is specified.

Source Error:

Line 100: DataView filteredResults = Destionations.DefaultView;//
.Select("CountryCode = '" + countryCode + "'").
Line 101: filteredResults.Sort = "CountryCode ASC";
Line 102: return filteredResults.FindRows(countryCode);
Line 103:
Line 104: //Table.Select has a problem, DataView also has another
problem


Source File:
C:\KBS\Components\SevDerKutuphaneleri\Controllers\LocationController.cs
Line: 102

Stack Trace:

[ArgumentException: Find finds a row based on a Sort order, and no Sort
order is specified.]
System.Data.Index.FindNodeByKeys(Object[] originalKey) +456
System.Data.Index.FindRecords(Object[] key) +36
System.Data.DataView.FindRows(Object[] key) +100
KBSLibrary.Controllers.LocationController.GetCountryDestinations(String
countryCode) in
C:\KBS\Components\SevDerKutuphaneleri\Controllers\LocationController.cs:102
SearchBoxAll.LoadDestinationDropDown() in
c:\KBS\WebSite\DesktopModules\KBS\SearchBoxAll.ascx.cs:93
SearchBoxAll.LoadDropDownsByStartingWithCountry() in
c:\KBS\WebSite\DesktopModules\KBS\SearchBoxAll.ascx.cs:87
SearchBoxAll.Page_Load(Object sender, EventArgs e) in
c:\KBS\WebSite\DesktopModules\KBS\SearchBoxAll.ascx.cs:23
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o,
Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +58
System.Web.UI.Control.OnLoad(EventArgs e) +127
System.Web.UI.Control.LoadRecursive() +101
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Control.LoadRecursive() +211
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2588

[PageLoadException: Find finds a row based on a Sort order, and no Sort
order is specified.]
DotNetNuke.Services.Exceptions.Exceptions.ProcessPageLoadException(Exception
exc, String URL) +474
System.Web.UI.TemplateControl.OnError(EventArgs e) +114
System.Web.UI.Page.HandleError(Exception e) +105
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5311
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +399
System.Web.UI.Page.ProcessRequest() +105
System.Web.UI.Page.ProcessRequest(HttpContext context) +292
ASP.default_aspx.ProcessRequest(HttpContext context) +59
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+610
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +177


Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET
Version:2.0.50727.833

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


--

CTO
http://www.kbstours.com

Som Nath Shukla

unread,
Sep 24, 2007, 5:06:02 AM9/24/07
to
Line 100: DataView filteredResults = Destionations.DefaultView;//
> .Select("CountryCode = '" + countryCode + "'"). make it clear whta is this
> Line 101: filteredResults.Sort = "CountryCode ASC";
> Line 102: return filteredResults.FindRows(countryCode);
> Line 103:
> Line 104:

it seem to be working fine.
what u want to do with this Select("CountryCode = '" + countryCode + "'").
its not proper

Laura T.

unread,
Sep 24, 2007, 5:37:22 AM9/24/07
to
Have you tried this?

using(DataView filteredResults = new DataView(Destionations));
{
filteredResults.Sort = "CountryCode ASC";
return filteredResults.FindRows(countryCode);
}


"KBS Tours Development" <devel...@kbstours.com> ha scritto nel messaggio
news:AB658764-6047-40A8...@microsoft.com...

KBS Tours Development

unread,
Sep 24, 2007, 6:15:44 AM9/24/07
to
Hi Som,

Actually I didn't exactly told the problem.
This actually works 95% of the time for the same query, but in 5% of the
time I got this weird error.

Can you also tell me what is improper?

--

CTO
http://www.kbstours.com
"Som Nath Shukla" <SomNat...@discussions.microsoft.com> wrote in message
news:868397DC-D980-4E11...@microsoft.com...

KBS Tours Development

unread,
Sep 24, 2007, 6:40:44 AM9/24/07
to
Hi Laura,


Actually I didn't exactly told the problem.
This actually works 95% of the time for the same query, but in 5% of the
time I got this weird error.

However I will also try your recommendation.
I hope this will finalize my problem.

Thanks

--

CTO
http://www.kbstours.com
"Laura T." <LT_...@yahoo.com> wrote in message
news:u1$7X6o$HHA....@TK2MSFTNGP06.phx.gbl...

Laura T.

unread,
Sep 25, 2007, 6:13:15 AM9/25/07
to
Yes, I tought that it was working, and because of that tought that your
problem could be a race condition with the default view. Creating a new
avoids that.

"KBS Tours Development" <devel...@kbstours.com> ha scritto nel messaggio

news:1902FF8D-9D6E-4E3E...@microsoft.com...

0 new messages