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. Web Development
  3. ASP.NET
  4. Database results to Array?

Database results to Array?

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-netsql-serversysadmin
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.
  • B Offline
    B Offline
    bjjonesey
    wrote on last edited by
    #1

    I have an interesting situation. I am doing a DB query to lookup email addresses from a SQL server table. I want to then put those addresses into an email to be sent programmatically. So there could be anywhere from 1 to x email addresses. Kind of new to asp.net and was curious as to the communities thoughts on if an array or collection would be better, or something else?

    Ben Jones

    S 1 Reply Last reply
    0
    • B bjjonesey

      I have an interesting situation. I am doing a DB query to lookup email addresses from a SQL server table. I want to then put those addresses into an email to be sent programmatically. So there could be anywhere from 1 to x email addresses. Kind of new to asp.net and was curious as to the communities thoughts on if an array or collection would be better, or something else?

      Ben Jones

      S Offline
      S Offline
      Sameer Alibhai
      wrote on last edited by
      #2

      I would say use System.Collections.Specialized.StringCollection This is a specialized collection of strings.. Or you can use System.Collections.Generic.List i.e. System.Collections.Generic.List myList = new System.Collections.Generic.List(); If you know the exact number of results, array is just raw memory and fastest too, whereas using these above data structures requires some overhead..

      Author, SharpDeveloper.NET

      B 1 Reply Last reply
      0
      • S Sameer Alibhai

        I would say use System.Collections.Specialized.StringCollection This is a specialized collection of strings.. Or you can use System.Collections.Generic.List i.e. System.Collections.Generic.List myList = new System.Collections.Generic.List(); If you know the exact number of results, array is just raw memory and fastest too, whereas using these above data structures requires some overhead..

        Author, SharpDeveloper.NET

        B Offline
        B Offline
        bjjonesey
        wrote on last edited by
        #3

        Great thanks for the advice!

        Ben

        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