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. General Programming
  3. C#
  4. Returnig parametrs from sql statment

Returnig parametrs from sql statment

Scheduled Pinned Locked Moved C#
questiondatabasehelptutorial
2 Posts 2 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.
  • M Offline
    M Offline
    microuser_2000
    wrote on last edited by
    #1

    hellow to all .. i am trying to return a parameter from sql statment that i insert , how can i do it ? for example i have a sql statment that inset into a table i wanna when i insert a value to Return the indx that i just inset or created ... if anyone can please direct me or help me i will be thankfull ....

    C 1 Reply Last reply
    0
    • M microuser_2000

      hellow to all .. i am trying to return a parameter from sql statment that i insert , how can i do it ? for example i have a sql statment that inset into a table i wanna when i insert a value to Return the indx that i just inset or created ... if anyone can please direct me or help me i will be thankfull ....

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      http://www.developerfusion.co.uk/show/4278/3/[^] In a nutshell: // add a new parameter, with any name we want - its for our own use only SqlParameter sqlParam = com.Parameters.Add("@ReturnValue", SqlDbType.Int); // set the direction flag so that it will be filled with the return value myParm.Direction = ParameterDirection.ReturnValue; Then, after the stored procedure has been executed, int returnValue = (int)com.Parameters["@ReturnValue"].Value

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      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