Gathering Information From a ListBox

databases United States
  • 19 years ago

    This is probably a stupid question but I can't seem to figure it out.  I have a section where the user  enters information into text1 and they hit the "add" button.  This then sends the text to a listbox, they can do this multiple times.  My question is, when I go to save this information from the list to the database how do I do this.

  • 19 years ago

    For i = 0 to List1.Count - 1
        cConn.Execute ("INSERT INTO TheTable (Field1) VALUES ('" & List1.List(i) & "'")
    Next


    where cConn is an ADO connection object...

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler