Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
how to add column in datatable in c# with default value c#?
Mani Kandan
Jun 29 2016 5:17 AM
1.4k
Reply
Sir,
adp.Fill(ds);
After fill the database items, I want to add extra coloum with new arraylist values
DataRow drr = ds.Tables[0].NewRow();
ds.Tables[0].Columns.Add("Column1", typeof(string));
ArrayList listArr = new ArrayList();
listArr.Add(SchemeColorValues.Accent1);
listArr.Add(SchemeColorValues.Accent2);
listArr.Add(SchemeColorValues.Accent3);
listArr.Add(SchemeColorValues.Accent4);
foreach (var data in listArr)
{
//
How can fill listArr each value here to datatable coloum name '
Column1
'?
}
dt = ds.Tables[0];
Kindly replay me.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Draw multiple line using abstract class
Exception: file windows.props not found VS2013