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. DBML generation and SQL UDF [modified]

DBML generation and SQL UDF [modified]

Scheduled Pinned Locked Moved LINQ
csharpdatabasesql-servervisual-studiolinq
2 Posts 2 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.
  • L Offline
    L Offline
    Lafoye
    wrote on last edited by
    #1

    Using functions from SQL server (2005/2008) in linq and encountering a problem with return values. When generating the dbml, visual studio types the function return as system.nullable... [Function(Name="dbo.ToTime", IsComposable=true)] public System.Nullable<System.DateTime> ToTime([Parameter(Name="String", DbType="NVarChar(MAX)")] string @string) Which in this particular case does not work for me (and manually editing it after generation would be troublesome in my environment). I've tried everything I can think of and have come to the conclusion that visual studio's dbml generator simply types any nullable type as nullable. I hope I am wrong...does anyone have any words of wisdom here? Thanks in advance

    modified on Friday, April 2, 2010 12:25 PM

    M 1 Reply Last reply
    0
    • L Lafoye

      Using functions from SQL server (2005/2008) in linq and encountering a problem with return values. When generating the dbml, visual studio types the function return as system.nullable... [Function(Name="dbo.ToTime", IsComposable=true)] public System.Nullable<System.DateTime> ToTime([Parameter(Name="String", DbType="NVarChar(MAX)")] string @string) Which in this particular case does not work for me (and manually editing it after generation would be troublesome in my environment). I've tried everything I can think of and have come to the conclusion that visual studio's dbml generator simply types any nullable type as nullable. I hope I am wrong...does anyone have any words of wisdom here? Thanks in advance

      modified on Friday, April 2, 2010 12:25 PM

      M Offline
      M Offline
      Michael J Eber
      wrote on last edited by
      #2

      The database generation is driven solely by the data in the database. If you have a function with parameters and no default value then you end up with nullable parameters every time. If you have fields in your table marked as nullable then your data is nullable. For parameters you can pretty much ignore the whole nullable thing if you always pass a parameter.

      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