IQueryable and NullException

IQueryable and NullException

Postby Falke » Mon 05 Oct 2009 11:51

I want to make a xml File, i use following code:
how can i say if film.content is null, that it should be filled with a empty string?
the assignment works but if i go through the objects e.g. with a for each through the filmlist the error occure.

Does sombody know, what i could do?

Dim list As System.Linq.IQueryable(Of System.Xml.Linq.XElement)
filmliste = From film In context.Films _
Where film.startdate >= Now.Date _
Order By film.startdate _
Select
<%= film.startdate %>
<%= film.Titel %>
<%= film.note %>
<%= film.Title2 %>
<%= film.Content %>
Falke
 
Posts: 9
Joined: Sun 06 Sep 2009 15:09

Postby AndreyR » Wed 07 Oct 2009 07:38

I have just tried to run the similar code and succeeded in executing For Each statement.
Could you please send me a small test project illustrating the problem?
Please include the script of your DB objects in it.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby Falke » Thu 08 Oct 2009 21:18

okey i will send it to you tomorrow evening ...

how should i send it? i don't want to make it public ...

you don't have in your profile an e-mail and this board doesn't accept pm ...
Falke
 
Posts: 9
Joined: Sun 06 Sep 2009 15:09

Postby AndreyR » Fri 09 Oct 2009 08:29

Send it to support * devart * com with subject "LINQ: Null problems".
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for MySQL