473,395 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

HierarchicalDataSourceControl Class (FileSystemDataSource example)

Hi

I'm working on creating a hierarchical data source control to represent data
in an SQL database in a hierarchical way. To get started learning how to
create these controls, I decided to recreate to example on the
FileSystemDataSource.

Step 1

I created a class library called FileSystemDataSourceControl, and copy and
paste the code in the file called FileSystemDataSourceLib.cs in a namespace
called econcordia. Finally I build the Class library and produce
FileSystemDataSourceControl.dll

Step 2

I create a second project called mySite. While in design mode for
Default.aspx, I right click on the toolbar and select Choose Items... . I
then browse to the dll file I created previously. Now I can see
FileSystemDataSource under the general tab. I drag FileSystemDataSource to
the designer for Default.aspx. If I Press F5 (or Start Debugging), there are
now errors on the screen. I then drop an instance of the treeview in the
designer for default.aspx, and bind it to FileSystemDataSource1. Then when I
run it, I get the following error in FileSystemDataSourceLib.cs.

return (temp.GetFileSystemInfos().Length > 0);

An unhandled exception of type 'System.StackOverflowException' occurred in
mscorlib.dll

I have the feeling that the treeview is in and endless loop, constantly
calling the GetHierarchicalView method from the FileSystemDataSource class.
Also, if I delete the FileSystemDataSource from the designer in page
default.aspx, and instead put the following code in the Page_Load event for
page Default.aspx it works.

Econcordia.FileSystemDataSourceView v = new
Econcordia.FileSystemDataSourceView(".");

TreeView1.DataSource = v.Select();
TreeView1.DataBind();

So the previous code works, but I would like it, to be able to drag and
instance of the FileDataSource to the designer of page Defautl.aspx and get
it to work. Could someone help me get this example working? Here's a link to
the article. If someone can help me get this working I would really
appreciate it.
http://msdn2.microsoft.com/en-us/lib...cecontrol.aspx
Feb 28 '06 #1
2 2928
I apologize for the types. The following line in step 2 reads as follows

If I Press F5 (or Start Debugging), there are now errors on the screen.

replaced it with

If I Press F5 (or Start Debugging), there are no errors on the screen.

"Francis Reed" wrote:
Hi

I'm working on creating a hierarchical data source control to represent data
in an SQL database in a hierarchical way. To get started learning how to
create these controls, I decided to recreate to example on the
FileSystemDataSource.

Step 1

I created a class library called FileSystemDataSourceControl, and copy and
paste the code in the file called FileSystemDataSourceLib.cs in a namespace
called econcordia. Finally I build the Class library and produce
FileSystemDataSourceControl.dll

Step 2

I create a second project called mySite. While in design mode for
Default.aspx, I right click on the toolbar and select Choose Items... . I
then browse to the dll file I created previously. Now I can see
FileSystemDataSource under the general tab. I drag FileSystemDataSource to
the designer for Default.aspx. If I Press F5 (or Start Debugging), there are
now errors on the screen. I then drop an instance of the treeview in the
designer for default.aspx, and bind it to FileSystemDataSource1. Then when I
run it, I get the following error in FileSystemDataSourceLib.cs.

return (temp.GetFileSystemInfos().Length > 0);

An unhandled exception of type 'System.StackOverflowException' occurred in
mscorlib.dll

I have the feeling that the treeview is in and endless loop, constantly
calling the GetHierarchicalView method from the FileSystemDataSource class.
Also, if I delete the FileSystemDataSource from the designer in page
default.aspx, and instead put the following code in the Page_Load event for
page Default.aspx it works.

Econcordia.FileSystemDataSourceView v = new
Econcordia.FileSystemDataSourceView(".");

TreeView1.DataSource = v.Select();
TreeView1.DataBind();

So the previous code works, but I would like it, to be able to drag and
instance of the FileDataSource to the designer of page Defautl.aspx and get
it to work. Could someone help me get this example working? Here's a link to
the article. If someone can help me get this working I would really
appreciate it.
http://msdn2.microsoft.com/en-us/lib...cecontrol.aspx

Feb 28 '06 #2

I've had the same experience. I have also written my own hierarchical
data source following the example, with similar results.

I'm pretty confident the example is erraneous. What happens is the data
bound control (the treeview) makes repeated calls to
GetHierarchicalView, with different values for the viewPath parameter
(the descendants of the root node). Since the sample returns the same
view every time, the calls seems never to get past the first child,
restarting every time, as it were.

Or so I thought. But having changed the code to create and return a new
view every time, the same error occurs. So I haven't gotten to the
bottom of it yet.

Good luck.

--
Fixme
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: E G | last post by:
Hi! I am having problems in designing a class. First, I have a base class that allocates a 3D data set and allows some other mathematical operations with it, something like this: template...
8
by: Bryan Parkoff | last post by:
I find an interesting issue that one base class has only one copy for each derived class. It looks like that one base class will be copied into three base classes while derived class from base...
1
by: Marcos Boyington | last post by:
Hey guys, quick question about how C++ designers chose to not implement this, I'm sure there are some people here who can take a better guess at it than I. So, in C++, the only way to prevent...
12
by: Manolis | last post by:
Hi, I was wondering if there is any way to make two objects of the same class to be able to access each other's private data, like this: class A { public: void access( const A& a )...
2
by: Eamon Millman | last post by:
Greetings, I'm fairly new to the new ASP.NET 2.0 controls and I'm trying to get the TreeView control to display some non-xml/sitemap data I want to have in a tree format. To accomplish this...
7
by: WXS | last post by:
Vote for this idea if you like it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=5fee280d-085e-4fe2-af35-254fbbe96ee9...
8
by: Jackson | last post by:
I want a class that will determine its base class by the argument passed in. What I am about to write _does_not_work_, but it shows what I am trying to do. class ABC(some_super): def...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
12
by: Gordon | last post by:
I want to provide a set of static functions in a superclass that work with class constants defined in a decendant of that class. Unfortunately I've run into a snag with this idea. Example: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.