StuMak
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.
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.
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?
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?
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.
Thanks for your fast response and I would accept gladly any other idea.
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
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
Sure.
TotalAsText.zip
TotalAsText.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sure, I will try the same actions that you did and i will let you know.
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.
Thanks alot.
Regards,
StuMak.
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.