I WANT CONVERSION IN linq VB.NET [modified]
-
select ListingName + '(' +
case ltrim(rtrim(sedol))
when null THEN ''
WHEN '' THEN ''
else 'SEDOL : ' + sedol + ' , '
end
+
case ltrim(rtrim(isin))
when null THEN ''
WHEN '' THEN ''
else ' ISIN : ' + isin + ' , '
end
+
case ltrim(rtrim(CUSIP))
when null THEN ''
WHEN '' THEN ''
else ' CUSIP : ' + CUSIP
endfrom CP_ProjectListing where projectid = 349
modified on Saturday, August 23, 2008 1:05 AM
-
select ListingName + '(' +
case ltrim(rtrim(sedol))
when null THEN ''
WHEN '' THEN ''
else 'SEDOL : ' + sedol + ' , '
end
+
case ltrim(rtrim(isin))
when null THEN ''
WHEN '' THEN ''
else ' ISIN : ' + isin + ' , '
end
+
case ltrim(rtrim(CUSIP))
when null THEN ''
WHEN '' THEN ''
else ' CUSIP : ' + CUSIP
endfrom CP_ProjectListing where projectid = 349
modified on Saturday, August 23, 2008 1:05 AM
What's your question? What are you trying to do?
-
select ListingName + '(' +
case ltrim(rtrim(sedol))
when null THEN ''
WHEN '' THEN ''
else 'SEDOL : ' + sedol + ' , '
end
+
case ltrim(rtrim(isin))
when null THEN ''
WHEN '' THEN ''
else ' ISIN : ' + isin + ' , '
end
+
case ltrim(rtrim(CUSIP))
when null THEN ''
WHEN '' THEN ''
else ' CUSIP : ' + CUSIP
endfrom CP_ProjectListing where projectid = 349
modified on Saturday, August 23, 2008 1:05 AM
Use the If function.
dim query = from x in CP_ProjectListing _
where x.projectid = 349 _
select x.ListingName & _
If(x.sedol is Nothing OrElse x.sedol.Trim="", "", "SEDOL : " & x.sedol) & ", " & _
If(x.isin is Nothing OrElse x.isin.Trim="", "", " ISIN : " & x.isin & ", " & _
If(x.CUSIP is Nothing OrElse x.CUSIP.Trim="", "", " CUSIP : " & x.CUSIPI would suggest this looks like it's generating data for a report or something - I would recommend against putting what is effectively UI code in the query (string formatting): let the query return the data fields, let the UI determine how to present it.
'Howard
-
What's your question? What are you trying to do?
He wants something converted in Linq, and is wanting someone to do it for him.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham