Listbox Control

Discussion in 'ASP .Net Web Controls' started by Brian Pittman, Oct 22, 2003.

  1. Hi,

    What would be the most efficient way to add items from a multi select
    listbox control into a SQL 2K table. For example I want new record added
    for each selected item in the listbox. I am able to do the task but in an
    inefficient way like the code below.

    For Each li In lstPDType.Items
    If li.Selected = True Then
    learning.Add(li.Value, objectID) 'This is a funtion that adds the
    item to a table everytime
    End If
    Next

    any help is appreciated

    Brian
     
    Brian Pittman, Oct 22, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DC Gringo
    Replies:
    0
    Views:
    535
    DC Gringo
    Apr 6, 2004
  2. kent
    Replies:
    1
    Views:
    1,018
    Andrew de la Harpe
    May 3, 2004
  3. Simon Prince
    Replies:
    2
    Views:
    3,561
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  4. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,850
    Chris Kettenbach
    Jun 16, 2005
  5. bh_jodokast

    Drag from one listbox to another listbox

    bh_jodokast, Oct 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    530
    bh_jodokast
    Oct 7, 2005
  6. COHENMARVIN
    Replies:
    1
    Views:
    691
    =?Utf-8?B?U3JlZWppdGggUmFtKE1DU0QuTkVUKQ==?=
    Oct 14, 2005
  7. John Dalberg

    drag & drop from listbox to listbox?

    John Dalberg, Feb 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    978
    =?Utf-8?B?RFdT?=
    Feb 21, 2006
  8. Replies:
    0
    Views:
    418
Loading...