Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Name of a Dataset Field
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352502
Message ID:
01352532
Views:
22
>Hi.
>Anybody know of a way to programtically change a Field Name of a daaset
>e.g. I have a dataset (that comes from a Table) with Field names of :
>CUS_AcNum
>cUS_Nam
>CUS_TEL
>
>and I want to change the Dataset field names to:
>Account
>Name
>Tel
>
>and then use these renames in all my data handling
>

Code like this should work:
// C#
ds.Tables[0].Column["Name"].ColumnName = "NewName";

'' VB
ds.Tables(0).Column("Name").ColumnName = "NewName";
I did a bit of more searching and found this article, which suggests copying the resulting dataset because of an error with case sensitivity:

http://support.microsoft.com/kb/815545
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform