Insert multiple record into table using ado.net ?

G

Guest

I need to insert into a table multiple item of a listbox. (item.text and item.value
Right now, I'm using an OleDBConnection with Access, a Command(Insert string) and parameters. I don't see how an ExecuteNonQuery() would fit in a loop ? Must be a simple solution out there

dim Item as listIte
for each Item in ListBox1.Item
INSERT INTO TABLE...
next Item
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

The hard thing about a listbox is you have to loop through all of the
choices. Other than that it is very simple. The ExecuteNonQuery() will allow
an insert without the overhead of expecting a reply. This has to be worth
something in terms of performance.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
Jeff said:
I need to insert into a table multiple item of a listbox. (item.text and item.value)
Right now, I'm using an OleDBConnection with Access, a Command(Insert
string) and parameters. I don't see how an ExecuteNonQuery() would fit in a
loop ? Must be a simple solution out there ?
 
G

Guest

But how exactly do I code it... in the for next loop, do I include the parameters ? thank's
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top