Solved

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

Posted on 2013-06-25
2
441 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 500 total points
ID: 39276816
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
ID: 39286452
Exactly what I was looking for. Thank you!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

697 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