1. NHibernate vs. LINQ to Entities
2. NHibernate and standard SQL issue - CSharp/C#
3. Combination of Linq to sql and Linq to xml
Hi folks I am pretty new to linq and in one of my first samples I tried to do the following: In my sample-database I have a table which has some columns and one of them has the type 'xml'. sample-data ID varcharcolumn1 varcharcolumn2 xmlcolumn 1 test test <xml><name>Test</name></xml> 2 test2 test2 <xml><name>nodata</name></xml> Is it possible to get all Rows where the xml-Column has a node 'name' with a Textnode that starts with 'T' using LINQ? Thanks Philipp Haenggi
4. Linq to SQL - Return DataTable as a result of Linq query - CSharp/C#
5. Mixing linq to sql and linq to xml (in linqpad)
Hi group,
In my database, I have a table with fields like this :
id | title | xml
------------------------------------
1 | title1 | <datas><data><item name="item1">value1</
item><item name="item2">value2</item></data></datas>
.....
I would like to filter my xml data, when it contains a item attribute
named item1
I'm using Linqpad with a request like that :
from i in myTable
where
i.xml.Descendants("data").Element("item").Attribute("name").Value ==
"item1"
select i
but, linqpad tells me that :
'System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement>'
does not contain a definition for 'Element' and no extension method
'Element' accepting a first argument of type
'System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement>'
could be found (press F4 to add a using directive or assembly
reference)
Is this possible ? How to correct it ?
Thanks in advance for any help
6. Question about LinQ (LinQ to Sql) - CSharp/C#
7. Linq 2 sql, enum, no supported translation to SQL
Hi, I'm using linq 2 sql, and I specified a custom enum type
(CompanyType) to one of the Company table field.
When I'm querying like this:
IEnumerable<CompanyType> validTypes= ...;
var v = from c in db.Companies
where validTypes.Contains(c.CompanyType)
select c;
I got an exception says:
Method 'Boolean Contains(MyNamespace.CompanyType)' has no
supported translation to SQL.
If I use int instead of "MyNamespace.CompanyType" as the type of
property "CompanyType" (and the IEnumerable<int> validTypes),
everything works. So what should I do to make my custom enum types
work?
Thanks!