Question: I want to populate a LINQ table from code, not DataBase.
Is it possible ?
System.Data.Linq.Table<Question> myquestions = new System.Data.Linq.Table<Question>();
Then something like:
myquestions.Rows.Add(aquestion);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just populate a regular DataTable and you can use it from LINQ
In the code above you can see how to use LINQ to filter out certain records from the DataTable. You’ll need to add the System.Data.DataSetExtensions assembly to your references
IEnumerables are readonly so you can’t really do it the way you’re asking, but what I’ve presented is the correct way.