[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP.NET - Build a DataTable from scratch

Posted on 2009-04-22
2
Medium Priority
?
584 Views
Last Modified: 2012-05-06
I have some data that I would like to display in a gridview so I can take advantage of the formatting features that it offers.  However, the data that I currently have from the database is not organized in a way that I would like to display it in the gridview.  I want to reorganize it and prepare a new DataTable to bind to the gridview control.

What is the process that I would go through to create a new DataTable, define its column names, create the individual DataRows and start adding them to the DataTable?
0
Comment
Question by:josephdaviskcrm
  • 2
2 Comments
 
LVL 15

Expert Comment

by:spprivate
ID: 24209828
what you mean by not organized.is it the sequence or what.
I would rather write the query in such a way i need and let the grid do the rest
0
 
LVL 15

Accepted Solution

by:
spprivate earned 2000 total points
ID: 24209838
Anyway if that is what you want here is how
http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses

868 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