Ask Experts Questions for FREE Help!
Ask    ||    Answer
 
Advanced  
 

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Visual Basic   »   Insert listbox items into a ms sql database

 
Thread Tools Search this Thread Display Modes
Question
 
 
#1  
Old Aug 27, 2009, 06:44 AM
Mistery1
Junior Member
Mistery1 is offline
 
Join Date: Sep 2008
Posts: 39
Mistery1 See this member's comment history on his/her Profile page.
Insert listbox items into a ms sql database

Hi everyone,

I hope someone can help me.

I have a listbox of many items and a table with many columns to acommodate these items from the listbox. I have basically have for every item in the listbox has its own column in the database.

I need to know when someone closes the application completley, whatever items in this listbox should be inserted into the database, into their respective columns.

This is part of my code that is my main focus , the rest of the code is the connection to the database

For Each item In ListBox2.Items
myCommand.CommandText = "Insert Into Programs (Printer1,Printer2 ) values ('" & ListBox2.Text & "','" & ListBox2.Text & " ')"
myCommand.ExecuteNonQuery()
Next


Anyhelp would be really appreciated.

Reply With Quote
 
     


Your Answer
Email me when someone replies to my answer
Join Login





Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

 
Similar Sponsors


Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page

Similar Threads
Add a time from a TextBox into a ListBox
(11 replies)
Listbox and textbox in vb.net
(3 replies)
ListBox problem
(1 replies)
act database 2000 entering notes to entire database or printing group notes
(0 replies)
get arraylist fields in listbox
(0 replies)

Search this Thread

Advanced Search

Bookmarks

Sponsors



Copyright ©2003 - 2009, Ask Me Help Desk.
All times are GMT -8. The time now is 03:20 AM.