Solved

update dataset column

Posted on 2011-03-03
2
380 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 13

Accepted Solution

by:
agarwalrahul earned 500 total points
ID: 35033702
Try this code:

ds.Tables[0].Columns[0].ColumnName = "somecolumnname";
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 35034981
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 ...)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A short film showing how OnPage and Connectwise integration works.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now