C# - IHierarchicalEnumerable The Prefered Way Of Dealing With Hierarchical Data?

Dec 14, 2010

I'm building an asp.net mvc app, I want to build up an hierarchical structure, is IHierarchicalEnumerable and IHierarchyData the best way to implement a hierarchical structure?

View 1 Replies


Similar Messages:

Forms Data Controls :: Dealing With Timeout On Long SP Execution?

Sep 23, 2010

I am executing a stored procedure that takes about 75 seconds to execute. My page times out while it tries to wait for the resultset. I tried adding Connect Timeout=200; pooling='true'; Max Pool Size=200" but it still times out.

I guess I do not necessarily need to wait for the result set. Is it possible to just send the SQL command with something like (making it up:) command.ExecuteOnServerAndDoNotWait?

Here is my code:

[Code]....

View 2 Replies

Asp - Editing Hierarchical Data

Aug 13, 2010

I just finished making a change to an ASP.NET Ajax screen from a few years back. It was harder than expected to build and maintain. On this change, I estimated 12 hours and spent 4 days. Granted I also did extensive refactoring to simplify the code. This is actually some pretty fun code, but I wonder if there was a better route for the original implementation than the one I took. To start, here's a screenshot:

The Problem So obviously this is an editable tree of data. The data behaves very differently at each level -- very different sorting/collision rules and so on. My solution is actually performant and provides an adequate user experience, but it's nearly 2,000 lines of code spanning 11 classes, which is more than I envisioned going in. I'm curious if you've solved similiar problems and if you were able to find a simpler solution. It looks pretty straightforward at a glance, maybe that means I did something right. But there is some real complexity here -- obviously you can add and remove items at three different levels, and everything sorts similiar to a netflix queue, but with quirks. It also has to detect collisions on the various entities (in the image, if you changed day 5 to day 1, it would have to figure out which one is actually day one and move the other one).

The biggest problem was keeping track of the state, since users don't want to commit changes to the database as they work. I thought it might be possible to use the actual controls (nested repeaters in this case) to represent this interim state, but that ended up being a dead end due to complexities related to the underlying data. The Solution To solve this, I created a full blown XML representation of all the data, which was actually great in some ways since I was able to use LINQ to do a lot of heavy lifting around sorting and querying. Still, there is a lot of code in here related to syncing up the xml to the html and so on, and I had to make a pretty hefty abstraction on top of the xml to make it easy for me to work with it in code. In case you're interested, I am currently persisting the XML to session state so that it will survive across callbacks, but eventually that should go into the database.

One colleague told me it would be better to use Flex or maybe Silveright for something like this, and I think that might be true since those are both much more stateful, although Silverlight was not ready for prime time back when this started, and I don't know Flex. Maybe using a temp table instead of xml would have been superior in some way. I'm looking to learn and improve -- what have your experiences been with this type of problem?

View 1 Replies

C# - Best Method To Search Hierarchical Data?

Mar 15, 2010

I'm looking at building a facility which allows querying for data with hierarchical filtering. I have a few ideas how I'm going to go about it but was wondering if there are any recommendations or suggestions that might be more efficient.

As an example imagine that a user is searching for a job. The job areas would be as follows.

1: Scotland
2: --- West Central
3: ------ Glasgow
4: ------ Etc
5: --- North East
6: ------ Ayrshire
7: ------ Etc

A user can search specific (i.e. Glasgow) or in a larger area (i.e. Scotland).

The two approaches I am considering are:

keep a note of children in the database for each record (i.e. cat 1 would have 2, 3, 4 in its children field) and query against that record with a SELECT * FROM Jobs WHERE Category IN Areas.childrenField.
Use a recursive function to find all results who have a relation to the selected area.

The problems I see from both are:

Holding this data in the db will mean having to keep track of all changes to structure.
Recursion is slow and inefficent.

I'm using C# ASP.NET with MSSQL 2005 DB.

View 5 Replies

C# - Three Level Hierarchical Data-linq?

May 7, 2010

I have three level hierarchical data. using the statement below i managed to display two level data. I need to extend it to one more level.

Current hierachy is Modules-->Documents

I need to extend it as Packages-->Modules-->Documents

var data = (from m in DataContext.SysModules join d in DataContext.SysDocuments on m.ModuleID equals d.ModuleID into tempDocs from SysDocument in tempDocs.DefaultIfEmpty()
group SysDocument by m).ToList();

View 2 Replies

.net - Show Hierarchical Data In A Dropdownlist?

Mar 21, 2010

I have a table in SQL Server 2005.

I want to show all domain name in a dropdownlist maintaing the same hierarchy. i.e

Law
Engineering
--civil
--Mechanical
Medical
--Dental
----Cavity
--MBBS

I need to append '--' according to the domain level. Is it possible using a sql query. or alternatively can I have any other control to show this data.

View 3 Replies

Web Forms :: How To Display Hierarchical Data In Checkboxlist

Jan 19, 2010

how to display hierarchical data in checkboxlist

View 6 Replies

Forms Data Controls :: Hierarchical Data Display And Hopefully Update?

Mar 29, 2010

When a user updates a record via detailsview in table 1 (TA), I need to display child records which are in table 2 (SG) and their child records which are in table 3 (SC). I tried to use DataList inside another DataList but I cannot filter the table 3 records based on returned values of table 2. I am also using TableAdapters and added a relation for table 3 to table 2 via both primary keys of table 2. I selected to create Both Relation and Foreign Key Constraint and Cascade as Accep/Reject Rule.

For my select statement on table 2, I filter it via WHERE (SGPrimaryKeyCd = :SGPrimaryKeyCd) AND (SGPrimaryKeyDate = :SGPrimaryKeyDate) and return the correct records based on values entered by the user.

For my select statement on table 3, I tried using a WHERE clause but didn't work. Without a Where clause I get all the records, of course. I thought relation would take care of filtering.

[Code].....

View 2 Replies

Forms Data Controls :: How To Display Data In Hierarchical Format

Dec 28, 2010

This maybe simple thign to you but I need to display data in below hierarchical format. I am using ASP.NET, VB.NET.

Company
- Product1
- Product2
- Product3
- Product4

There will be only 1 root node (Company) in my case. And it will have 1 or more child nodes. These child nodes will not have any further child, ie they are leaf nodes.

How to display this data in this format using ASP.NET & VB.NET?

View 1 Replies

Forms Data Controls :: Hierarchical Data In Gridview From Dataset?

Mar 27, 2010

I want to display child rows in the datagrid after the + sign is selected (like grouping & outlining in excel). This is automatic in infragistic grids but when i did in asp (no more infragistics) it doesnt work. here is my code (very simple stuff)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
DataSet ds = new DataSet();
ds.Tables.Add(myDataAccess.ExecuteSelectCommand("uspCategories"));
ds.Tables[0].TableName = "tblCategories";
ds.Tables.Add(myDataAccess.ExecuteSelectCommand("uspProducts"));
ds.Tables[1].TableName = "tblProducts";
DataRelation rel = new DataRelation("relation", ds.Tables[0].Columns["CategoryID"], ds.Tables[1].Columns["CategoryID"]);
ds.Relations.Add(rel);
GridView1.DataSource = ds;
GridView1.DataBind();

View 3 Replies

Forms Data Controls :: Retrieving And Displaying Hierarchical Data?

Jul 21, 2010

I'm in the process of developing a survey system. The tables / fields that are related to my question are:

[Code]....

My issues with this way were:

1) The Data Adaptors receive ALL the records from their correspondent tables. Not a good practice, I believe.

2) If, at some point, the survey had no categories, questions or choices under its child records, an error occurs when the page tries to build the Data Relation. With the work flow I had in mind for the system, this is bound to happen becuase all the Data entry pages (Add Category, Add Question, Add Choice) will be displaying the newly-created survey in a similar fashion (at which point, the survey will have no child records and so an error would occur)

View 3 Replies

C# - How To Build A Self-referencing Model Object For Hierarchical Data In MVC

Sep 9, 2010

I'm trying to understand how to build a self referencing model for hierachical data. Eventually i will be creating a category tree.

I don't anything in tables yet. After I have the structure nailed down then I will create the tables. My existing Object is defined like this:

public class Categories

[Code]....

View 1 Replies

Forms Data Controls :: 3.5 Tabular DataList Hierarchical?

May 20, 2010

I want to learn how to show html in a situation of a tabular format to One To Manyto make me understand I have the categories and subcategories for each category I wish we were all subcategories.I tried with a DataList, but the categories repeated for each subcategoryIs there a way to do it. For example in asp.net mvc I wrote everything in aspx page

View 3 Replies

Forms Data Controls :: Create Hierarchical Grid Using C#?

Dec 13, 2010

how to create hierarchical grid using c#

View 1 Replies

Forms Data Controls :: Displaying Hierarchical Data In One Row?

Feb 6, 2010

I have a gridview that displays in the following manner. What I am trying to accomplish to is if you see the columns with the heading(s) Name, LegName, MedicalConditions, DateofBirth and id displays as two rows, as it normally would, but what I would like to do is to have all that data display in ONE Row because it all belongs to one registration. If you look at the two images, image one is how the data comes out of the DB normally. Image two is how I would like to be. keep in mind that this is a small example and I actually have more fields than just this, so I am looking for something extensible. Anyone have any thoughts on how I could modify the gridview to display my data like this?

View 2 Replies

DataSource Controls :: How To Display Hierarchical Structure In A Data Control

Mar 19, 2010

i have a table with parent-child relationship wherein each child in turn can have multiple associated children. i want to display data in an hierarchical way with collapse and expand features.i dont want to use 'listview inside a listview inside a listview' approach. and yes i have googled it but cudnot find anything useful for my scenario. has someone successfully tried implementing this ?

View 4 Replies

Forms Data Controls :: How To Create Hierarchical-master / Detail UI

Aug 11, 2010

So here is the situation - there is data on master records - its a hierarhical view - something like (ID, IDParent, Title) and detail data - (ID, IDMaster, Details)

And like to build UI using an TreeView - binded with master data - and an GridView - binded with detail data.

Question is witch property to use to create the master/detail chain between Datasources - oh, I've forgot to tell I'm using an ObjectDataSource?

View 3 Replies

Converting Hierarchical Data Into An HTML Unordered List Programmatically Using C#?

Mar 16, 2010

I've data which looks something like this.

[code]....

To convert the above data into unordered list based on depth, I'm using the following code

[code]...

But the resulting unordered list doesnt seem to be forming properly(using which i am constructing a tree).For example "Site " with id '180' is supposed to appear as a direct child of "Televisions" with id '1',is appearing as a direct child of 'Flash' with id '191' using my code.so in addition to considering depth,I've decided to consider itemid as well in order to get the treeview properly.Those rows of the table with itemId not equal to null are not supposed to have a child node(i.e.,they are the leaf nodes in the tree) and all the other nodes can have child nodes.

Update:

The 'itemid' column refers to the id of an item which is present in another table.This column just in identifying if an item has any sub items(i.e., 'name' in my data in this case has any other unordered lists under it).

View 1 Replies

Forms Data Controls :: Make A Hierarchical Gridview With 1 Freeze Column?

Dec 4, 2010

I want to make a hierarchical gridview with 1 freeze column.

i have freeze a column in general gridview but it was not working on internet explorer 8.

View 3 Replies

Sql - Dealing With XML In MVC?

Jan 21, 2010

I have a block of XML in a database which is easy enough to pull out using ASP.NET MVC, however I would like to access and modify the XML in an way more consistent with class instances. Is there a way to get the MVC (or any other model) to generate a data access (or perhaps Entity) class set from the DB-stored XML?If the above is rather obtuse, the question could be summarised as; What method would you use to best access and modify XML stored in a database from an ASP.NET MVC application?

View 1 Replies

Forms Data Controls :: Hierarchical GridView And Payment Button Firing Multiple Times

Feb 23, 2011

I have developed an application using Visual Studio 2008. I have a hirerchical gridview and on every row i have a "Payment" button which actually inserts a payment entry in database. Here is the sample screen of that gridview so u have an idea what i am doing. Problem is that whenever user pressed the button of "PAYMENT" it is inserting multiple records in database..it should only fire once and i am failed to understand why its firing multiple times. Refer this link for my payment screen: [URL]

[Code]....

My code behind--------------------

[Code]....

View 3 Replies

MVC :: Using NHibernate For Dealing With The DB Interactions?

Jan 21, 2010

Im currently starting on a project where im using NHibernate for dealing with the DB interactions, and MVC2 (RC) for the front end... and im just wondering if there are any decent tutorials on how to minimize the amount of duplicated validation that needs to be entered to validate thigns in NHibernate and try to mirror those constraints client side.. Ive looked at xVal which looks great, but i cant seem to get it to work and there dont seem to be that many articles about it. Also alot of people are mentioning that its going to become redundant at the MVC level in MVC2 due to the data annotation validation. So im really just after some more information/advice and links on the subject really...

View 2 Replies

Dealing With Screen Scrappers And Bots

Oct 4, 2010

I got a bot and screen scrapper problem. I have successfully redirected them somewhere else, but they still show up in my stats. I run my redirection code in the pre init section of the master page. I use discountasp for my hosting provider. Is there a way to run my code before the preinit page section?

View 8 Replies

MVC :: Create Paging When Dealing With Postbacks?

Mar 31, 2011

I have the following scheme: a View (comming from an action method) called EventSearch that contains a DropDownList of PowerPlants, a ListBox with GeneratingUnits, a DropDownList and two TextFields to set the timespan (you can choose a predefined timespan in the DropDownList or set your own in the TextFields). The model for this page is a DataQuery (an object to be tested against the Database to search the matching values). Clicking in a button in this View will cause a POST.

Then, in another View, called EventList, with the Model being List, I render the above Action, so the user can trigger a search in the same page he visualizes the results.Usually, the number of itens in the list to be displayed in EventList is massive, so I wanted to give paging a try:

[Code]....

when I try sorting or even change page, the results don't get displayed. Here is my ActionMethods for EventList:

[Code]....

I don't know if it doesn't work by the way I created the pages (using this DataQuery object) and if there is another way out of this problem.

View 3 Replies

Is JQuery The Best Way Of Dealing With User Interaction In C# .net Environment

Oct 8, 2010

.net has all these build in GUI elements. The purpose is that we build a .net web application and for the coding itselve I'm very familiar with jQuery in PHP but I noticed that in .Net everybody starts using it too.Is jQuery the best way these days to deal with this in .NET (c#)? or are there others you might recommend?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved