- 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...