Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
Hi programmers there, am developing a system in I want to insert bulk records in a table hence i want an control that will select all records(after binding it)so that i can use it in an insert into sql statement. Does dropdownlist control support selection of all record, i know it support multiple selection but i want all records to be selected.

Any idea of a control that can do this
Posted 13-Apr-13 4:21am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can have a control similar to: Multiselect Dropdown for Web Applications[^] - you can add one option of 'select all' at the top of items.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

i used a listbox with a do while loop


i As Integer = 0

While i < ListBox1.Items.Count



commandString =

"INSERT INTO xt (b) VALUES('"+listBox.items().Tostring() +"' );"

con.ConnectionString =

"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\simple.mdf;Integrated Security=True;User Instance=True"


cmd.Connection = con

cmd.CommandText = commandString


"Records Added Successfully")



"Records NOT Added")


System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
end while

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sascha Lefévre 490
1 Sergey Alexandrovich Kryukov 353
2 Maciej Los 210
3 Abhinav S 205
4 Richard Deeming 180
0 Sergey Alexandrovich Kryukov 6,928
1 OriginalGriff 6,381
2 Maciej Los 2,782
3 Abhinav S 2,732
4 Peter Leow 2,694

Advertise | Privacy | Mobile
Web02 | 2.8.150414.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100