Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2004

Tip: Looking for answers? Try searching our database.

Same column names being renamed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marina - 18 Mar 2004 15:25 GMT
Hi, let's say that the result of a query that has some joins, brings back
some columns that have the same name. .Net starts numbering them.  So they
became "someCol", "someCol1", "someCol2", etc, even though in reality, they
were all called "someCol".

Is there any way to tell what the original column name was once the data is
in a DataTable?

Renaming all the columns in the query is NOT an option.
Patrice Scribe - 18 Mar 2004 17:59 GMT
I believe this could be done using the TableMappings property - never used
as I always use distinct names ;-)

Try
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
consettingupdatatabledatacolumnmappings.asp


Patrice

> Hi, let's say that the result of a query that has some joins, brings back
> some columns that have the same name. .Net starts numbering them.  So they
[quoted text clipped - 5 lines]
>
> Renaming all the columns in the query is NOT an option.
Marina - 18 Mar 2004 18:04 GMT
I've looked at that, it is empty after the Fill.

> I believe this could be done using the TableMappings property - never used
> as I always use distinct names ;-)
>
> Try

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
consettingupdatatabledatacolumnmappings.asp


> Patrice
>
[quoted text clipped - 9 lines]
> >
> > Renaming all the columns in the query is NOT an option.
Patrice Scribe - 19 Mar 2004 09:45 GMT
Can you perform updates on this datatable ? (if yes it's likely kept
somewhere).

> I've looked at that, it is empty after the Fill.
>
> > I believe this could be done using the TableMappings property - never used
> > as I always use distinct names ;-)
> >
> > Try

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
consettingupdatatabledatacolumnmappings.asp


> > Patrice
> >
[quoted text clipped - 11 lines]
> > >
> > > Renaming all the columns in the query is NOT an option.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.