I'm approaching LINQ to LLBLGen for the first time, but I'm having an issue.
I'm executing the following code
Dim metaData As New LinqMetaData(DAL.DataAdapterFactory.GetThreadDataAdapter(enDalDB.eDBDati))
Dim q = From c In metaData.Persona
Where c.Nome <> "Massimiliano"
Select c
This code should load a collection of PersonaEntity, the field PersonaEntity.Nome is a nullable string.
This LINQ generate the following SQL, with a wrong where.
Query: SELECT [LPLA_1].[IDPersona] AS [Idpersona], [LPLA_1].[IDAppellativo] AS [Idappellativo], [LPLA_1].[IDTitoloOn] AS [IdtitoloOn], [LPLA_1].[Cognome], [LPLA_1].[Nome], ......
FROM [Persona] [LPLA_1] WHERE ( ( ( ( [LPLA_1].[Nome] = @Nome1))))
Parameter: @Nome1 : String. Length: 100. Precision: 0. Scale: 0. Direction: Input. Value: "Massimiliano".
My LINQ say: Where c.Nome <> "Massimiliano"
but the generated SQL say: WHERE ( ( ( ( [LPLA_1].[Nome] = @Nome1))))
So I'm asking for a string "not equal to", but instead I get the string "equal to" the specified one.
Even the LINQ "Where c.Nome >"Massimiliano"" generate a "=" in SQL
If I try the same thing on an integer field, instead, it works as it should.
I'm using the following development setting:
*) LLBLGenPro 2.6 Final (09-October-2009) (Library Lib 2.6.10.0930)
*) Code generation: Adapter/VB.Net 3.5/Standard Templates
*) .Net 3.5, VisualStudio 2010
*) Database: Access2k
Thanks, Massimiliano