.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

posted on 2007-02-04 17:45  念时  阅读(1030)  评论(0编辑  收藏  举报

细节决定成败!态度决定一切!