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. ADO.NET output parameter

ADO.NET output parameter

Scheduled Pinned Locked Moved Database
questioncsharpdatabase
3 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.
  • T Offline
    T Offline
    Timothy_1982
    wrote on last edited by
    #1

    Hi, i would like to know how it's possible to work with a output parameter. i already worked this way for input: "insert into ... (test, test2) values(@test, @test2)" and then i add those parameters to the parameterscollection of my odbccommand object. now i want to do a simple select of one column: "select test from testtable" but how can i retrieve that value , the result of my query i mean, without working with a dataset or a reader. is it possible to also work with parameters for this? grtz & thx

    C 1 Reply Last reply
    0
    • T Timothy_1982

      Hi, i would like to know how it's possible to work with a output parameter. i already worked this way for input: "insert into ... (test, test2) values(@test, @test2)" and then i add those parameters to the parameterscollection of my odbccommand object. now i want to do a simple select of one column: "select test from testtable" but how can i retrieve that value , the result of my query i mean, without working with a dataset or a reader. is it possible to also work with parameters for this? grtz & thx

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      If your result set is one column in one row then you can use ExecuteScalar();


      My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      T 1 Reply Last reply
      0
      • C Colin Angus Mackay

        If your result set is one column in one row then you can use ExecuteScalar();


        My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

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

        thx that works ;) and what if i don't have more than one value, let's say: select test, test2 from testtable how do i get the value of test and test2 ? (without reader and without filling a dataset)

        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