On Wed, 2010-06-09 at 01:57 -0700, wind cloud wrote:
> Hello, I think there's still some problem left using nullable types in
> VB.NET with dblinq.
> Here's a situation:
> 
> Table A:
> Column 1 INT(10) NULL DEFAULT NULL
> Some other columns ....
> 
> now if I want to get data from table A and filter them by column1,
> obviously I have to execute this in linq in VB.NET
> 
> Dim some_value As Integer = 123
> Dim result = context.TableA.Where(Function(entry)
> Nullable.Equals(entry.Column1, some_value))
> 
> or
> 
> Dim result = From entry in context.TableA where
> Nullable.Equals(entry.Column1, some_value)
> 
> either way. However, they always throws out an exception from within
> dblinq.dll at around AnalyzeMember or something, I can post the exact
> exception result if you guys need it.

That would be useful; could you file a bug?

As a workaround, you might try accessing the Nullable<T> members
directly instead of using System.Nullable, e.g.

        context.TableA.Where(e => 
                entry.Column1.HasValue && 
                entry.Column1.Value == some_value);

 - Jon


-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to