Needing some help with this

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
28,050
Reaction score
17,803
Needing some help with this please guys

I'm busy trying to fix up this project I am working on, however my understanding of LINQ is severely lacking. Could someone please give me a clue as to what should go here, because the bold bit is getting flagged with an error. I'm not sure what should go there.

Code:
Dim ListToProcess = Directory.GetFiles(serverPath & "\Documents\Notes", "*", SearchOption.AllDirectories).Where(Function(x) [B]dataForWord[/B].Select(Function(y) y(12)).Contains(x.Split("\").Last().Split(".").First.Split(" ").Last))

'dataForWord' is not declared. It may be inaccessible due to its protection level.

I suspect this dataForWord is perhaps a book mark or placeholder put in by someone else.

Any help will be appreciated!
 
Last edited:
I unfortunately don't know much about vb syntax, so I can help there, but if I were you I'd just unroll the stack into standard code.
 
I think what this guy was trying to do was strip away the file path and extension and just get the filename.

Seems like an awfully painful way of doing it :erm:
 
'dataForWord' is not declared in the context in which this linq query runs.

Also, make the code more readable by having your '.' methods on it's own line with the correct indentation. I think you can do that with VB.Net also.

But back to the issue though. dataForWord is a list or something that should be declared either in your method or class and it's not there.
 
Top
Sign up to the MyBroadband newsletter
X