Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
Hi programmers there, am developing a system in asp.net/vb.net. I want to insert bulk records in a table hence i want an asp.net 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
mayeso654
Rate this: bad
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i used a listbox with a do while loop


Dim


i As Integer = 0



While i < ListBox1.Items.Count

SetSelection(

True)

commandString =

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

con.ConnectionString =

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

con.Open()

cmd.Connection = con

cmd.CommandText = commandString

DisplayMessage(

"Records Added Successfully")

cmd.ExecuteNonQuery()

DisplayMessage(

"Records NOT Added")

con.Close()

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

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