Query an Access database using LinQ in Visual Basic 2012
Posted on 2014-04-29
I am in a Visual Basic class learning about querying an Access database using LinQ. And struggling. I have an Access database. I have added it as a datasource in my project. Now I want to query the table and write the result to a variable.
The dataset name is Project3dbdataset.
The column names are Character, SkillLevel, Level, Score, and Damage
Here is my code:
Dim SL1 = From txtSkillLevel In Project3dbdataset
Where Character = 7
It fails at Dim SL1 = From txtSkillLevel In Project3dbdataset
Project3dbdataset is a type and cannot be used as an expression.
How do I access the dataset with the query?