Click here to Skip to main content
12,695,049 members (30,247 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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
mayeso656
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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2017
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