Solved

update dataset column

Posted on 2011-03-03
2
389 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

806 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