The red ellipse line causes an error "Datatable already belongs to this DataSet." How to fix it?
Attachments: Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.
You will need to make a copy of that table via DataTable.Copy. Once done, use the copy.
How to make a copy? I tried the following syntax. However, "Copy" is redlined. Please help!
Greetings, Copy is a method so use Copy()
After adding a pair of brackets, it is still redlined.
Here is how to use Copy
DataSet ds = new DataSet();
DataView dv = new DataView();
dv = ds.Tables["StudentList_Table"].DefaultView;
DataTable dataTable = dv.Table;
DataTable copyTable = dataTable.Copy();
var count = copyTable.Rows.Count;
After copying your code, the redline disappears. However, after pressing the down arrow, the following error still appears.
A DataTable named 'StudentList_table' already belongs to this DataSet.
8 people are following this question.
ASP.NET CORE server side processing to acces to the files stored in FILE TABLE ?
Insert a node as child ,before or after a node in nested dynamic JSON Node using C#
saving a disposed RichTextBox
How to collapse individual nested grids/stackpanels inside a grid?
Run existing TapGestureRecognizer from code behind