I'm not quite sure of the different between
DataTable itemTable = new DataTable();
itemTable = //CODE
and
_ = new DataTable();
DataTable itemTable = //CODE
Both worked exactly the same, why would I need to change it to an _ like shown?
IMAGE OF THE "POTENTIAL FIX"
Because you have not used the value new DataTable()
after assigning, the intellisense thought that you won't need it, so just made the leftside wildcard.
Its just like:
int a = 5;
a = 6; // you didn't even used the value 5 assigned above!
But, in case that the constructor of DataTable
has side-effect, the intellisense suggested you not to discard the entire statement, using wildcard _. That's what happened.
If the constructor of DataTable
has no side-effect, you are free to remove the statement, just like the above int
example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With