Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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.
 
Share this answer
 
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900