Link to home
Start Free TrialLog in
Avatar of StuMak
StuMakFlag for Greece

asked on

LINQ to Typed Dataset problem

Hi,
In an application I am using an XML file as data storage and I am using it's data through a typed dataset. I tried to execute a very simple LINQ query, like

var recordHd1 = from r in ds.RecordHd select r;

and I got the following error
"Cannot convert lambda expression to type 'string' because it is not a delegate type"

Any good ideas?

Thanks in advance,
Stavros Makridis.
Avatar of wht1986
wht1986
Flag of United States of America image

hmm I assume RecordHd is the data table in your dataset?

I just ran a query test with a dataset i just made here

 DataSet1 ds = new DataSet1();
    var l = from d in ds.Employees
            select d;

and had no errors.
saw 1 other post that had this issue resolved by ensuring these were both declared on the page

using System.Data.Linq;
using System.Linq;

Are you using any of the new Sql Server data types in the datatable? just date, just time, geography, etc?
Avatar of StuMak

ASKER

In my original post, I mentioned that I am not using SQL Server at all. The data storage under dataset is an XML file. So I am not using any new SQL datatypes in my datatables. As for the two using lines, I had them both in the file that the code snippet belongs to.

Thanks for your fast response and I would accept gladly any other idea.
Avatar of Fernando Soto
Hi StuMak;

Can you post the Strongly typed DataSet class and a sample of the XML file, I would like to run through some test to figure out why you are having the issue.

Fernando
ASKER CERTIFIED SOLUTION
Avatar of wht1986
wht1986
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of StuMak

ASKER

Sure, I will try the same actions that you did and i will let you know.
Avatar of StuMak

ASKER

You were right wht1986, the initial project was created for .Net 2.0 and the solution you suggested solved the problem.

Thanks alot.


Regards,
StuMak.