logo       

Re: DataTable binding problem: msg#00154

windows.devel.dotnet.web

Subject: Re: DataTable binding problem

An interesting "solution" I have found so far is that if I do a
throwaway Select on the DataTable specifying no filter, but specifying a
sort order, everything works.

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-WEB@xxxxxxxxxxxxxxxxxxx] On Behalf Of Jason Capriotti
Sent: Friday, January 28, 2005 1:30 PM
To: DOTNET-WEB@xxxxxxxxxxxxxxxxxxx
Subject: [DOTNET-WEB] DataTable binding problem

I load a DataSet with a few DataTables in OnInit. I do an initial
Repeater bind to it in Page_Load for the purpose of event handling on
PostBacks, and a second bind to it in OnPreRender.



The Repeater's DataSource is the result of a Select() function call,
possibly with filter and order parameters.



The problem is that if I add a filter to the Page_Load select, I receive
the error shown below. Adding a filter to the OnPreRender select, I do
not receive an error. Any thoughts?



Error follows:

Index was outside the bounds of the array.



Stack Trace:

[IndexOutOfRangeException: Index was outside the bounds of the array.]

System.Data.Select.CreateIndex()

System.Data.Select.SelectRows()

System.Data.DataTable.Select(String filterExpression, String sort)

DS.Web.InfoDirect.Data.OFM.OrderGuideProducts.GetData()

DS.Web.InfoDirect.OFM.Display.MangeOGProducts.Page_Load(Object
sender, EventArgs e)

System.Web.UI.Control.OnLoad(EventArgs e) +67

System.Web.UI.Control.LoadRecursive() +35

System.Web.UI.Page.ProcessRequestMain() +750





Thanks,
Jason


===================================
This list is hosted by DevelopMentor(r) http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise