SQL Stored Procedures

ajaybabuChajaybabuCh Member Posts: 208
edited 2007-10-17 in SQL General
Hi

I am executing the stored procedures from Navision through ADO.

If the stored procedure returns some boolean value or some other value

then How to get the return value of the stored procedure from Navision.

Regards
Ajay
Ajay

Comments

  • ajaybabuChajaybabuCh Member Posts: 208
    can anybody give an idea on this
    Ajay
  • WaldoWaldo Member Posts: 3,412
    Well, I've never done this before, but it should be the same as you do it in .NET . 8-[

    Isn't it possible like this?
    Sub Page_Load(Sender As Object, E As EventArgs) 
    
    
    Dim myConnection As SqlConnection = _ 
    New SqlConnection(ConfigurationSettings.AppSettings("DSN"))
    
    Dim MyCommand as SQLCommand = New SQLCommand("spReturnarticleId", MyConnection)
    
    MyCommand.CommandType = CommandType.StoredProcedure
    
    
    myConnection.Open()
    
    
    'Execute the Stored Procedure, return the value and increment it by 1
    
    Dim count As Int32 = CInt(myCommand.ExecuteScalar()) + 1
    
    dim strID as string = cstr(count)
    
    
    'Set the value of a textbox
    
    text1.text = strId
    
    
    'Set the Value of a message to test what value is returned
    
    Message.InnerHtml = strId
    
    myConnection.Close()
    
    End Sub
    
    

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • PhennoPhenno Member Posts: 630
    ajaybabuCh wrote:
    can anybody give an idea on this


    search on mibuso or dynamicsuser.net (sorry for advertisings...), I have posted some examples for retreiving values of storage procedures...
  • WaldoWaldo Member Posts: 3,412
    Phenno wrote:
    ajaybabuCh wrote:
    can anybody give an idea on this


    search on mibuso or dynamicsuser.net (sorry for advertisings...), I have posted some examples for retreiving values of storage procedures...

    Ah, OK ... :oops:

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • PhennoPhenno Member Posts: 630
    Waldo wrote:
    Phenno wrote:
    ajaybabuCh wrote:
    can anybody give an idea on this


    search on mibuso or dynamicsuser.net (sorry for advertisings...), I have posted some examples for retreiving values of storage procedures...

    Ah, OK ... :oops:


    hhehhh... no need for ooops :)

    http://www.mibuso.com/forum/viewtopic.p ... +parameter
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from Navision forum to SQL General forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.