473,473 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

add item from textbox to listbox during runtime

25 New Member
Hi, I have a combobox, textbox, listbox, and a save button. Combobox is filled with illness names stored from database. Every illness that will be selected from the combobox, its symptoms will be listed in the listbox. When a symptom is typed in the textbox and save button is clicked, the selected value from the combobox and the new symptom typed from the textbox will be saved in the database and the newly typed symptom should be added in the listbox..but I can't add the item from textbox to listbox. I already tried lstIllness.Items.Add(textbox1.text) but got an error, it says 'Items collection cannot be modified when the data source property is set'. Please help me. Thanks
Mar 14 '13 #1
1 2070
Rabbit
12,516 Recognized Expert Moderator MVP
Add the item to the data source instead and then requery the listbox.
Mar 14 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Newbie | last post by:
Hello! I'm trying to figure out how to do the following: I need to show a table (perhaps using DataGrids, repeaters or others) for each salesperson in the sales dept. But the no. of tables...
1
by: | last post by:
Hello everybody... How can i unplug selected item in Listbox. Thanks in advance. Paulo
0
by: Hai Nguyen | last post by:
I want to add a text box into a template column during runtime. I can add a boundcolumn but not with template column. I allow user to type in something in the textbox in the datagrid. I wanna know if...
3
by: Sampson | last post by:
I have a question about enumeration and how to populate them during runtime. I am using vb.net but will happily take any advice in c# as well. Here is an example to help illustrate what I am...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
5
by: yancheng.cheok | last post by:
hello, may i know how i can determine whether a pointer is pointing to an array or a single item during runtime? this is because in certain situation, i need to determine whether to use delete...
3
by: mattgcon | last post by:
I was curiuos if anyone knew of a way to allow drag and drop functionality on the actual controls themselves during runtime within a Windows Application. I want to allow the user to customize a...
2
by: Rex | last post by:
Hi, I want to make a particular piece of text BOLD (during runtime) in a textbox. for example: consider a string "The next stage for plaque collection will be at the end of January". I want to...
1
by: polarbearvillage | last post by:
I am using Visual Basic 2005. Okay, I add items to a dropdown menu on a toolbar during runtime, and I when I click them, I need to shell the program that is associated with that one item (I have...
1
by: ton | last post by:
Hi, I want to add several textbox to my form during runtime: the code is very simple Lab = New TextBox Lab.ID = "A" & i Lab.Height = 200 Lab.Visible = True Lab.Text = "test"
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.