Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Data Web-Site - Where are the select statements

Status
Not open for further replies.

PGO01

Programmer
Jan 8, 2008
156
0
0
GB
I have just created a Dynamic Data Entities web-site on a SQL database, added the ADO .Net Entities and dragged my tables onto the designer.

I've now run it to see what it's like and it works, but it is very very slow.

The tables are indexed, and running selects from SQL get results back in 1-5 seconds, but on the web-site I can be waiting for 3 minutes.

In the 1 table - Client, there are 750,000 records. I really only want to return about 1/20 of these; ones that have an EmployeeID present.

Where/how do I do this in the code?

Is there something else that may be slowing things down?
 
Thanks, but the data is already paged automatically with Dynamic Data.
 
most webform data controls page the data on the client (code/memeory), which means all the rows are loaded into memory (possibly even view state) and then a subset of the in-memory results are rendered to the user.

working with a significant (more than 100) number of rows means abandoning the pre-canned data access crap that comes with webforms.

IIRC DDE works with either linq2sql or EF. in which case you can use the IQuerable<> interface to skip() and take() a page of data. something like
Code:
var results DataContext<Entity>
    .Where(...)
    .OrderBy(...)
    .Skip(page-1)
    .Take(20)
other ORMs (NH) implement paging with the methods SetFirstResult() and SetMaxResults().

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks.

Do you know how to set the Client list to load
Code:
SELECT * FROM Client WHERE EmployeeID IS NOT NULL
instead of
Code:
SELECT * FROM Client
in a dynamic data app?
 
even with the where clause you still run the risk of loading too many records which can make a system crawl. I don' have any experience with dynamic data applications. when I need a web UI i use an MVC framework to manage user requests.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
You can ignore my question. After playing around with that type of app in vs2010, I realize that it generates a tremendous amount of code for you. I guess that is the point, to help people build a quick app with as little amount of code as possible.
I think that most people who post here often would say to avoid this type of application as well as the datasource objects. What happens is that the more code is written for you, the less control over the application that you have. Also, you will not learn much about programming if that is what you are after. As you can see, you are having questions already with something that is supposed to just "work" for you. I would rethink this and possible write all the code yourself in a regular website.
 
Actually it is supposed to be quite customisable and still keeps the GUI / business layer / back-end completely separate. I think it's my lack of ASP .Net knowledge in general that is causing me problems.

I've found a code example of a dynamic data site that has been modified to uses stored proc's to select/insert/update/delete for 1 particular table. I'll have a look at that.

 
Actually it is supposed to be quite customisable and still keeps the GUI / business layer / back-end completely separate.
any tool that claims to generate an application with a wizard is only useful for the most trivial scenarios. the trivial scenarios are so few they have no practical purpose in a any sort of business application.

then there is the personal satisfaction... what fun it programming if the IDE writes it for you:)

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
True, but as much as I would like to spend a good amount of time on it and write it all myself properly, and I really would like that! This is something that has to be up and running by the end of, erm, Monday :(

It's an internal program so I think I'll give them the dynamic data app. which is very slow and if they want the speed improved they will just have to give me time to do it properly. :)

Thanks.
 
PGO01, that sounds like a very good approach actually, don' let the technical aspects limit the business need. If the business wants better preformance then you can request the time required to accomplish thqat. At that point I would recommend building it from the ground up instead of retro fitting a dynamic data app.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top