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. Database & SysAdmin
  3. Database
  4. Passing values to a stored proc

Passing values to a stored proc

Scheduled Pinned Locked Moved Database
csharpc++
8 Posts 6 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.
  • T Offline
    T Offline
    tasumisra
    wrote on last edited by
    #1

    can somebody tell me the ways of passing values to stored proc from C++ or C# code.

    vikas da

    E M 2 Replies Last reply
    0
    • T tasumisra

      can somebody tell me the ways of passing values to stored proc from C++ or C# code.

      vikas da

      E Offline
      E Offline
      Erdinc27
      wrote on last edited by
      #2

      i am not sure if u really meant that..here i sent cek_no value to my stored proc. like that.. cmd.Parameters.AddWithValue("cek_no", System.Data.SqlDbType.NVarChar).Value=table.Row[i][0].ToString();

      vemedya.com

      T 1 Reply Last reply
      0
      • E Erdinc27

        i am not sure if u really meant that..here i sent cek_no value to my stored proc. like that.. cmd.Parameters.AddWithValue("cek_no", System.Data.SqlDbType.NVarChar).Value=table.Row[i][0].ToString();

        vemedya.com

        T Offline
        T Offline
        tasumisra
        wrote on last edited by
        #3

        Thanks for the answer i ment in my question was suppose u need to pass 5 parameters .. so we can wither pass them separately or is there any other way to pass them when i can pass as single argument.

        vikas da

        J 1 Reply Last reply
        0
        • T tasumisra

          Thanks for the answer i ment in my question was suppose u need to pass 5 parameters .. so we can wither pass them separately or is there any other way to pass them when i can pass as single argument.

          vikas da

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          Then you repeat the above 5 times.

          1 Reply Last reply
          0
          • T tasumisra

            can somebody tell me the ways of passing values to stored proc from C++ or C# code.

            vikas da

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            Create a command object (sql client) add an array of sql parameters add a valid connection string to the command object execute the command (executescalar) Will you please do some research, a simple Google query will do - this question has been answered 1000s of times before and there are many many examples on the net showing you how to do this.

            Never underestimate the power of human stupidity RAH

            P 1 Reply Last reply
            0
            • M Mycroft Holmes

              Create a command object (sql client) add an array of sql parameters add a valid connection string to the command object execute the command (executescalar) Will you please do some research, a simple Google query will do - this question has been answered 1000s of times before and there are many many examples on the net showing you how to do this.

              Never underestimate the power of human stupidity RAH

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              No, it seems that he wants to pass a class or struct or something.

              M 1 Reply Last reply
              0
              • P PIEBALDconsult

                No, it seems that he wants to pass a class or struct or something.

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                PIEBALDconsult wrote:

                pass a class or struct

                How did you get that from the OP. The the answer would still be the same with an explanation that you cannot pass objects unless they are as xml data type X|

                Never underestimate the power of human stupidity RAH

                J 1 Reply Last reply
                0
                • M Mycroft Holmes

                  PIEBALDconsult wrote:

                  pass a class or struct

                  How did you get that from the OP. The the answer would still be the same with an explanation that you cannot pass objects unless they are as xml data type X|

                  Never underestimate the power of human stupidity RAH

                  J Offline
                  J Offline
                  Jorgen Andersson
                  wrote on last edited by
                  #8

                  Mycroft Holmes wrote:

                  How did you get that from the OP.

                  He's cheating, the mindreader function is to be released with SQL:2012.

                  "When did ignorance become a point of view" - Dilbert

                  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