LINQ Column problem

S

Steven Blair

Hi,

I have a simple LINQ to SQL query (check query 1)

http://pastebin.com/m71c9b2e8

This returns me the mapping of a table from my Database.

The problem I have is some of the columns need to be trimmed and isnull
checks.
If I was doing this in normal SQL I would simply perform the trim and
isnull on each column.

I need to do this in LINQ BUT I don't want to create a custom class
(check query 2 for an approach, but this fails with the following
exception:

Explicit construction of entity type FileProcessing.FileProfile' in
query is not allowed.)

I know I could create a new class and select a new class form the LINQ
statement and perform the checks, but this seems pointless since LINq
alreayd built the class I need to use (means if I update Database, I
don't have to change the class code.

Hope this makes sense and thanks.

Steven
 
S

Steven Blair

Patrice,

Thats fixed my problem. Thanks vert much.
Ideally the data would be in the condition I need it, but the Database
is in this state and there is not much I can do about it just now
unfortunately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top