Solved

DataTable Column MappingType C#

Posted on 2009-04-14
1
655 Views
Last Modified: 2013-12-17
Hi,

I have 2 question regarding MappingType

I did a column MappingType.Hidden for every column beforehand.

1.So how can i include multiple columns other then using this...
                datatable.Columns["column1"].ColumnMapping = MappingType.Element;
                datatable.Columns["column2"].ColumnMapping = MappingType.Element;
 
2.How can I un"hide" every element?So I can access to every column again?

Thanks for the reply in advance.
0
Comment
Question by:csharp_learner
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 300 total points
ID: 24136485
u can loop thru columns and set the mapping type
for(int i=0;i<datatable.Columns.Count;i++)
{
datatable.Columns[i].ColumnMapping = MappingType.Element;
}

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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