Hi,
I have created one DataTable programatically into C#. And I want to add duplicate DataColumns into it i.e. suppose I have one column named "Col1" and I want add one more column with the same name. Its giving "DuplicateNameException".
How should I make it possible. Is there any other way. Please provide some code.
Thank you.

duplicate columns into datatable
shoagMSFT
You could set your viewer/Editor ColumName/Caption to 'show' same 'Name' of column instead of you tying to make it inside datatable.
invalid display name
What are you trying to do that would make you think you need duplicate column names Perhaps you could create multiple datatables instead Or use Col1, Col2 etc.
zz1
Hi Prashant!
It does'nt make sense at all to have two column in the table with same name therefore its by design that databases doesn't allow duplicate column name in a table. Further more column name tells you what data where, if you have two columns with similar name how would search for data.
Can tell us the situation where you need duplicate columns, may be someone can you tell better way of doing it.
Cheers
Sohail.