Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > how to save data clicked from combobox to database


Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2005, 11:57 PM
just_askin just_askin is offline
Centurion
 
Join Date: Jan 2005
Location: where old houses abound
Posts: 120
Default how to save data clicked from combobox to database


this is the case... i need to choose A-Z in my combo... so what do i do to have whatever letter is clicked on the combo will be saved into databse?

tnx.
Reply With Quote
  #2  
Old 02-24-2005, 12:45 AM
webbone's Avatar
webbone webbone is offline
Hydrogen Powered

Administrator
* Expert *
 
Join Date: Jul 2003
Location: Sacramento, CA
Posts: 6,090
Default

You'll need to get the value of the combo box { Combo1.List(Combo1.ListIndex) }. open a connection to your database, and then either execute an INSERT command or create a new recordset, store the value, and Update.

If you aren't familiar with all of these things I'd suggest taking a look at the ADO Tutorial in our Knowledge Base
__________________
"With the appearance of the AddressOf operator, an entire industry has developed among authors illustrating how to do previously impossible tasks using Visual Basic. Another industry is rapidly developing among consultants helping users who have gotten into trouble attempting these tasks." -Dan Appleman
Reply With Quote
  #3  
Old 02-24-2005, 12:55 AM
just_askin just_askin is offline
Centurion
 
Join Date: Jan 2005
Location: where old houses abound
Posts: 120
Default

okay. tnx...

here's the situation i have three textboxes for student id, first name, surname and the combobox for the middle initial... does this mean, i will have to create separate recordsets for the data for the texboxes and the data for the combobox?
Reply With Quote
  #4  
Old 02-24-2005, 01:02 AM
webbone's Avatar
webbone webbone is offline
Hydrogen Powered

Administrator
* Expert *
 
Join Date: Jul 2003
Location: Sacramento, CA
Posts: 6,090
Default

If I am understanding you correctly, NO. If those three items are all fields in the same table then you just need one recordset.

I'd really suggest you go through the ADO Tutorial as well as loquin's excellent Standards and Practices tutorial - understanding how certain things about databases work will help you properly create your database and organize your information.
__________________
"With the appearance of the AddressOf operator, an entire industry has developed among authors illustrating how to do previously impossible tasks using Visual Basic. Another industry is rapidly developing among consultants helping users who have gotten into trouble attempting these tasks." -Dan Appleman
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->