scalar function call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?cm9kY2hhcg==?=

    scalar function call

    hey all,
    is it possible to call a sql server scalar function from c#?

    thanks,
    rodchar
  • Jeroen Mostert

    #2
    Re: scalar function call

    rodchar wrote:
    hey all,
    is it possible to call a sql server scalar function from c#?
    >
    Yes, but not directly. You'll have to use a statement of the form "SELECT
    dbo.FunctionNam e(@Param1, @Param2, ...)" and you can use .ExecuteScalar( ) on
    the command object. Be careful with the results: if it's NULL, you'll get
    DBNull.Value, otherwise an object of the most appropriate type.

    --
    J.

    Comment

    • Peter Duniho

      #3
      Re: scalar function call

      On Fri, 21 Mar 2008 12:16:01 -0700, rodchar
      <rodchar@discus sions.microsoft .comwrote:
      hey all,
      is it possible to call a sql server scalar function from c#?
      Seems like DbCommand.Execu teScalar() would do what you want. Right?

      Comment

      • =?Utf-8?B?cm9kY2hhcg==?=

        #4
        RE: scalar function call

        thanks all for the help,
        rod.

        "rodchar" wrote:
        hey all,
        is it possible to call a sql server scalar function from c#?
        >
        thanks,
        rodchar

        Comment

        Working...