New Posts New Posts RSS Feed: Need to load a substring over devforce
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Need to load a substring over devforce

 Post Reply Post Reply
Author
anishedhli View Drop Down
Newbie
Newbie
Avatar

Joined: 16-Mar-2012
Location: Paris
Posts: 2
Post Options Post Options   Quote anishedhli Quote  Post ReplyReply Direct Link To This Post Topic: Need to load a substring over devforce
    Posted: 21-Mar-2012 at 5:48am
Thanks a lot smi-mark and midnit (so kind from yourselves).
I solved it by making LINQ queries with anonymous types. the link that msi-mark suggested was very interesting and useful in my case :)
 
Back to Top
midnit View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
Post Options Post Options   Quote midnit Quote  Post ReplyReply Direct Link To This Post Posted: 19-Mar-2012 at 2:41pm
If the projection is not as easy to work with as you would like we did it another way.
 
Basically we defined the query for the entity in the model (rather than using table def) and the particular column was truncated in the query itself, then we created another entity with the records id and the full value and joined the two entities 1 to 1. Though these technically point to the same table in the database each entity had its particular data and we only retrieved the full data at one record at a time as necessary. It also allowed us to edit it easy enough.
 
I am not claiming this is a great solution but it worked in our situation.
 
In another more data intense scenario we ended up moving the lob to its own table but the model basically remained the same.
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 16-Mar-2012 at 1:19pm
You can use a projection to do what you want.

http://drc.ideablade.com/xwiki/bin/view/Documentation/query-anonymous-projections


Back to Top
anishedhli View Drop Down
Newbie
Newbie
Avatar

Joined: 16-Mar-2012
Location: Paris
Posts: 2
Post Options Post Options   Quote anishedhli Quote  Post ReplyReply Direct Link To This Post Posted: 16-Mar-2012 at 4:05am
Hello everybody

my problem is the following:
I have a field in a database table (the field is named "content"). During the loading of the table records, I don't want to extract the entire field value , but the x first characters.

Example:

Content = "Hello world , how are you ??"
what should be extracted = "Hello world"

I ask if there is a manner to make it directly in DevForce (cause of the huge amount of information to transport over the network).

Thanks a lot in advance
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down