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. returning arrays from function

returning arrays from function

Scheduled Pinned Locked Moved C#
data-structures
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.
  • D Offline
    D Offline
    DownBySpj
    wrote on last edited by
    #1

    i have to return a string array from a function. I hv to retrieve the name to employees from emp table having certain code and return it to the calling function to be used for other purpose. thanx in advance

    Z 1 Reply Last reply
    0
    • D DownBySpj

      i have to return a string array from a function. I hv to retrieve the name to employees from emp table having certain code and return it to the calling function to be used for other purpose. thanx in advance

      Z Offline
      Z Offline
      zhengdong jin
      wrote on last edited by
      #2

      public string[] getname() { DataSet ds = yourquery string[] abc = new string[ds.Tables[0].Rows.Count]; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { abc[i] = ds.Tables[0].Rows[i]["name"].ToString(); } return abc; }

      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