Solved

How do I programatically get the DataTable columns property through the ObjectDataSource?

Posted on 2006-11-10
1
549 Views
Last Modified: 2009-03-04
In the detailsview, I need to do something like:

DetailsView1.Fields[0].HeaderText = ObjectDataSource1.DataSource.DataTable.Column["ID"].Caption;

That doesn't work at all, it's a way of explaining.
I'm trying to get the DataTable columns returned to the ObjectDataSource, so I can access the individual columns and get the caption propery for the columns.
How do I do that ?

0
Comment
Question by:fischermx
1 Comment
 
LVL 3

Accepted Solution

by:
jay_gadhavi earned 500 total points
ID: 17928940
Use the datatable for binding the value of DetailsView.
Follow this step :
>Bind the Datatable with the Datasource
>with the help of for loop try to bind the DetailsView like as follows

   DetailsView1.Fields[0].HeaderText = DataTable.Rows(j).Item("columnname").ToString()

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…

828 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