Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 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

13 Experts available now in Live!

Get 1:1 Help Now