Populating a database with an array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • programmargorp
    New Member
    • Aug 2011
    • 8

    Populating a database with an array

    So i have some data in an 1 dimensional array, is it possible to dump this data into a database?
  • Paul Johnson
    New Member
    • Oct 2010
    • 97

    #2
    Yes

    (pseudocode)

    Call your string "foo"

    Code:
    Dim l as integer ' holds the string length
    Dim c as integer ' used for a loop
    
    l = String.Length(foo)
    
    'open sql, test it's good and if it is...
    for c = 0 to l
    Insert foo[l] into footable
    next c

    Comment

    • programmargorp
      New Member
      • Aug 2011
      • 8

      #3
      i dont understand ur code? =/

      Comment

      • Paul Johnson
        New Member
        • Oct 2010
        • 97

        #4
        The code is psuedocode (in otherwords, gives you the idea, but won't work by itself). The line l = String.Length(f oo) can be ignored (my bad)

        Start the loop at 0
        Insert the first member of the array into the database (insert <data> into <datatable>)
        Next loop

        I'm assuming you're connection to the database is fine

        Comment

        • programmargorp
          New Member
          • Aug 2011
          • 8

          #5
          thanks for ur help, but dw, i managed to find a way to dump my data into excel, sorry for the hassle.

          Comment

          Working...