Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

call SqlServer scalar function from .NET


I know how to call stored procedures from VB.NET, but is there a way to call Scalar Functions from .NET code? WOuld this work, even though I am calling a function and not a procedure?


            Dim cn As New SqlConnection("server=.\ddb;database=SFS;integrated security = true")
            cn.Open()

            Dim cmd As New SqlCommand("monthsForPivot", cn)
            'Dim cmd As New SqlCommand("make_fundingNew_05_dynamic_grossCenter", cn)
            cmd.CommandType = CommandType.StoredProcedure

            cmd.Parameters.AddWithValue("@endMonth", "200512")
            cmd.Parameters.AddWithValue("@format", "MTH")



ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brokeMyLegBiking
brokeMyLegBiking

ASKER

ha! very simple, very good.