Solved

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

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

726 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