.Net中使用带返回值的存储过程(VB代码)

    Function GetYFJEDX(ByVal yfje As Decimal) As String
        Dim fkjedx As String
        Dim myCMD As SqlClient.SqlCommand = New SqlClient.SqlCommand("MoneytoChinese22", sqlconn)

        myCMD.CommandType = CommandType.StoredProcedure
        myCMD.Parameters.Add(New SqlClient.SqlParameter("@ChangeMoney", SqlDbType.Money))
        myCMD.Parameters("@ChangeMoney").Value = yfje
        myCMD.Parameters.Add(New SqlClient.SqlParameter("@ReturnDaXie", SqlDbType.VarChar, 50))
        myCMD.Parameters("@ReturnDaXie").Direction = ParameterDirection.Output
        'sqlAdapter.Fill(sqlDs, "fkjedx_CX")
        sqlconn.Open()
        myCMD.ExecuteNonQuery()
        sqlconn.Close()
        fkjedx = myCMD.Parameters("@ReturnDaXie").Value
        Return fkjedx
    End Function

你可能感兴趣的:(.net)