• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

update dataset column

I can loop through dataset and get columnname. How can I update columns name? Sample column1 Named acct in dataset and I want to change it to Account.
1 Solution
Rahul AgarwalTeam LeaderCommented:
Try this code:

ds.Tables[0].Columns[0].ColumnName = "somecolumnname";
A remark - If you fill the dataset from the database and you change the columnname like agarwalrahul mentioned, the name of the column is not changed in the database !

If you really want this to happen, you'll need to send a ddl-statement (alter table ...)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now