Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. I WANT CONVERSION IN linq VB.NET [modified]

I WANT CONVERSION IN linq VB.NET [modified]

Scheduled Pinned Locked Moved LINQ
csharplinq
4 Posts 4 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nilish
    wrote on last edited by
    #1

    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
    end

    from CP_ProjectListing where projectid = 349

    modified on Saturday, August 23, 2008 1:05 AM

    J H 2 Replies Last reply
    0
    • N Nilish

      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
      end

      from CP_ProjectListing where projectid = 349

      modified on Saturday, August 23, 2008 1:05 AM

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      What's your question? What are you trying to do?

      P 1 Reply Last reply
      0
      • N Nilish

        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
        end

        from CP_ProjectListing where projectid = 349

        modified on Saturday, August 23, 2008 1:05 AM

        H Offline
        H Offline
        Howard Richards
        wrote on last edited by
        #3

        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.CUSIP

        I 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

        1 Reply Last reply
        0
        • J Judah Gabriel Himango

          What's your question? What are you trying to do?

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups