What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 15560 |  Welcome, Guest!   Register  Login
 Home > Forums > C# > Modifying the column value in a dataset ...
Santhosh.Nallavelli

Modifying the column value in a dataset

Replies: 1 | Posted by: Santhosh.Nallavelli on 8/9/2012 | Category: C# Forums | Views: 271 | Status: [Member] | Points: 10  


I have a table in a dataset having some columns which is reading from the xml file, in which i want to update a column values in the following way.
1-mon
2-tue
3-wed
4-thu
5-fri
6-sat
7-sun

example data

columnA columnB columnC
dot net 1,2,3
articles forums 1,4,5,6
tech blogs 1,2,3,4,5,6,7

my output should e

columnA columnB columnC
dot net mon,tue,wed
articles forums mon,thu,fri,sat
tech blogs daily

please suggest me .


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Saratvaddilli
Saratvaddilli  
Posted on: 8/9/2012 5:31:15 AM
Level: Bronze | Status: [Member] | Points: 25

We can use the Data Adapter, Fill the Adapter with the Data Set and use Adapter.Update Method


SqlDataAdapter adapter = new SqlDataAdapter();
adapter.UpdateCommand = new SqlCommand(sql, connection);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
connection.Open();
DataSet days = new DataSet();
adapter.Fill(days);
adapter.Update(days);

http://msdn.microsoft.com/en-us/library/at8a576f.aspx

Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

Santhosh.Nallavelli, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 11:48:18 PM