Solved

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

Posted on 2006-11-10
1
520 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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