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. Calling SP from .net

Calling SP from .net

Scheduled Pinned Locked Moved C#
databasecsharpsharepointhelpquestion
6 Posts 4 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.
  • A Offline
    A Offline
    Astricks
    wrote on last edited by
    #1

    Calling by the other way: Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.

    *

    M P 2 Replies Last reply
    0
    • A Astricks

      Calling by the other way: Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.

      *

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Astricks wrote:

      'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.

      You could use an SqlCommand object and pass the SQL command string as "exec sp_testproc '111','RR',23'".

      Michael CP Blog [^] Development Blog [^]

      A 1 Reply Last reply
      0
      • M Michael P Butler

        Astricks wrote:

        'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.

        You could use an SqlCommand object and pass the SQL command string as "exec sp_testproc '111','RR',23'".

        Michael CP Blog [^] Development Blog [^]

        A Offline
        A Offline
        Astricks
        wrote on last edited by
        #3

        Thanks, I'll try that.

        *

        R 1 Reply Last reply
        0
        • A Astricks

          Calling by the other way: Is it possible to call a stored procedure WITH PARAM from .net WITHOUT using "AddParams" ? I mean we should be able to call(exec) the SP just like we do in the query analyser. I'd construct the string like "sp_testproc '111','RR',23'". and execute it as nonQuery. Is there any way? please help.

          *

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          You could also stop cross posting.

          the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
          Deja View - the feeling that you've seen this post before.

          1 Reply Last reply
          0
          • A Astricks

            Thanks, I'll try that.

            *

            R Offline
            R Offline
            Russell Jones
            wrote on last edited by
            #5

            have a google for SQL Injection first. Russ

            M 1 Reply Last reply
            0
            • R Russell Jones

              have a google for SQL Injection first. Russ

              M Offline
              M Offline
              Michael P Butler
              wrote on last edited by
              #6

              Russell Jones wrote:

              have a google for SQL Injection first.

              Thanks for adding that. I really should have included that in my original reply.

              Michael CP Blog [^] Development 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