Solved

best way to pass query results from c# code behind to asp.net

Posted on 2013-06-25
2
438 Views
Last Modified: 2013-06-29
New to ASP.NET and C#, but seasoned database developer. What's the best way to pass query results from the C# layer to the presentation layer (ASP.NET)? Assuming an unknown # of rows and potential column additions on the fly (on the database side).

Thanks in advance!
0
Comment
Question by:merv11
2 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 500 total points
Comment Utility
I use a DataTable for most everything. Easy to bind to a GridView and many other controls. Easy to transform columns.

When passing rows to an ASP.NET control you only need worry about overloading  the web page (too much data/slow render times).
0
 

Author Comment

by:merv11
Comment Utility
Exactly what I was looking for. Thank you!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now