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. Problem in Changing Date Format in LINQ Select query

Problem in Changing Date Format in LINQ Select query

Scheduled Pinned Locked Moved LINQ
databasehelpcsharplinq
2 Posts 2 Posters 0 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.
  • K Offline
    K Offline
    K V Sekhar
    wrote on last edited by
    #1

    Hi all, I am trying to change the dateformat in linq select statement.

    var query = from t in datacontext.users
    select new
    { name = t.firstname +" "+t.lastname,
    date = t.dateofjoin.Value.ToString("dd-MMM-yyyy")
    };

    its not throwing any exception at runtime. but i am not getting any records into 'query'. it displays 'No Support Translation in SQL'. please help me. Thanks in advance, sekhar

    C 1 Reply Last reply
    0
    • K K V Sekhar

      Hi all, I am trying to change the dateformat in linq select statement.

      var query = from t in datacontext.users
      select new
      { name = t.firstname +" "+t.lastname,
      date = t.dateofjoin.Value.ToString("dd-MMM-yyyy")
      };

      its not throwing any exception at runtime. but i am not getting any records into 'query'. it displays 'No Support Translation in SQL'. please help me. Thanks in advance, sekhar

      C Offline
      C Offline
      chriskwok live cn
      wrote on last edited by
      #2

      can not be formatted in LINQ because the C# function doesnot be supported. you can format the properties after fetching them.

      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