Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get the OutPut Parameter?

How to get the OutPut Parameter?

Scheduled Pinned Locked Moved ASP.NET
databasecsharphelptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SIJUTHOMASP
    wrote on last edited by
    #1

    Hai, Any body can help me by telling How I can get the out put parameter value of the stored procedure which is executing as ExecuteReader. How I can get the value in ADO.NET. In Query analyser I am getting the value by 'select @msg'. Thanks very much. Thank You, Rahul.P.Menon

    G P 2 Replies Last reply
    0
    • S SIJUTHOMASP

      Hai, Any body can help me by telling How I can get the out put parameter value of the stored procedure which is executing as ExecuteReader. How I can get the value in ADO.NET. In Query analyser I am getting the value by 'select @msg'. Thanks very much. Thank You, Rahul.P.Menon

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Add the parameter to the command object and set the direction to output. After you have executed the procedure, you can read the value from the parameter object. --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        Add the parameter to the command object and set the direction to output. After you have executed the procedure, you can read the value from the parameter object. --- b { font-weight: normal; }

        S Offline
        S Offline
        SIJUTHOMASP
        wrote on last edited by
        #3

        Hai Guffa, Thanks a lot for the response. But her I am not creating any command object. Using the written class i am executing sp like SqlHelper.ExecuteReader(CustomConnString,DatabaseOwner & ObjectQualifier & sp_name,ouputpaaram) I am using sqlDataReader to get the records. Then how I can proceed.? Where I can add the parameter and read value? If I get more clarification on this that will be really helpful.Thanks very much. Thank You, Rahul.P.Menon.

        G 1 Reply Last reply
        0
        • S SIJUTHOMASP

          Hai, Any body can help me by telling How I can get the out put parameter value of the stored procedure which is executing as ExecuteReader. How I can get the value in ADO.NET. In Query analyser I am getting the value by 'select @msg'. Thanks very much. Thank You, Rahul.P.Menon

          P Offline
          P Offline
          peterzorbas
          wrote on last edited by
          #4

          if u use select statement then use a datareader. DataReader dr = sql.ExecuteReader() while(dr.read()) { msg = dr[0].ToString(); } dr[index] = the number of sequential columns in the sql statement so if u had select first, last, middle from table then it would be dr[0].ToString(), dr[1].ToString(), dr[2].ToString() or dr["first"].ToString(), dr["middle"].ToString(), dr["last"].ToString().

          1 Reply Last reply
          0
          • S SIJUTHOMASP

            Hai Guffa, Thanks a lot for the response. But her I am not creating any command object. Using the written class i am executing sp like SqlHelper.ExecuteReader(CustomConnString,DatabaseOwner & ObjectQualifier & sp_name,ouputpaaram) I am using sqlDataReader to get the records. Then how I can proceed.? Where I can add the parameter and read value? If I get more clarification on this that will be really helpful.Thanks very much. Thank You, Rahul.P.Menon.

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            You need a command object to use parameters. What do you do in the ExecuteReader method to run the procedure? --- b { font-weight: normal; }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups