Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
9
Reply
How to declare the data table column in c#?
Dinesh Santhalingam
Feb 2 2017 12:22 AM
221
Reply
class details
{
userdetails
userdetails
=
new
userdetails();
public string last;
public DataTable
generalinfo
=
new
DataTable();
public void loaddata(string [] path)
{
//Column were declared..............
/*generalinfo.Columns.Add("Name");
generalinfo.Columns.Add("Totalbike");
generalinfo.Columns.Add("Inuse");
generalinfo.Columns.Add("Time");*/
lines
=
path
;
//do something.............
}
}
I have a data table .I wish to declare the column for my data table.But If i declared in loaddata its creating some error.Because Loaddata is Run every time.So the Error raised.
Error:Datacolumn were already belongs to a data table ...
How to declare it before the load data .Please solve my issue?Thanks in advance...
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
9
)
Next Recommended Forum
is this code good? can be better?
Create a lookup attribute in CRM 2016