I have a simple database that I have created. I used EntityDeveloper to create a DataContext class for the database.
I have written some code to return information from a table in the database but I am getting an error when I try to execute the foreach loop. The error is reporting that the object q is an "Invalid datatype: Integer". Here is the code:
Code: Select all
testDataContext db = new
var q =
from x in db.AssetClass
select x;
foreach (var ac in q)
Console.WriteLine("ID = {0}, Name = {1}", ac.ID, ac.Name);