Hello all. I am currently learning in Academy and am a novice with c# (still learning it). I have no real experience with Visual Basic, so I have been doing all the exercises in c#. I have noted that it let’s you know that c# support is experimental atm, so I am curious to know if this is an issue due to that or due to my own newbishness.
Here is where I have my problem:
clubMembers = name.Select(“[Club Member]=‘Yes’”)
this throws System.InvalidOperationException.
“Cannot implicitly convert type ‘object’ to ‘System.Data.DataRow’. An explicit conversion exists (are you trying to cast?)”
I am still learning c#, so I feel it likely I just need pointed at what I need to know do do this. Is there anyone who could point me to the documentation where I need to read up?
Edit to add:
Also if someone could confirm/correct my understanding of why this is happening I would appreciate it. My interpretation of this error based on what I have read is that the method is returning an object, something like returning the cell of a spreadsheet but not the contents therein. Is that right?
Unless I am reading it wrong (which is possible given I am still a beginner), the documentation above for DataTable.Select(string) returns a DataTable. That is the command I am using, and I have typed it correctly. I even checked the sql expression, and I believe it is correct too.
Everything about this seems to have beet typed correctly, but I would like that to be confirmed if someone can do so. I suspect I may just be encountering a problem with the experimental state of c# support. I need to confirm that though because otherwise I will just keep working this problem looking for a solution. If no solution exists then I would like to move on.