Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Name of a Dataset Field
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352502
Message ID:
01352532
Vues:
21
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform