add/edit/delete from dataset, and bind a field in dataset to a combobox,
Posted on 2004-04-28
good day, the problem im having is that i need to fill textboxes according to the value the user clicks in a combobox.
the combobox is filled via a dataset.
from there i need to add edit and delete customers.
vb.net & access 2000,oledb
combobox: (user chooses) '1'
(then according to the userid)
THE DATA SIDE
i have a table called customers
the customers table has the fields
now i have a strongly typed dataadapter 'daCustomers' which only uses the customers field
the insert,delete & update commands are all working fine.
now i have a dataset which was generated by the daCustomers dataadapter.
if i preview the dataAdapter's fill dataset, i get the results fine, no problem
THE FORM SIDE
now the whole plan here is to be able to ADD, EDIT & DELETE customers.
this is what i got and now im stuck
i have 3 similar situations in this specific application and i would like to do this the right way so i can apply it in
all my future vb.net projects.
the specific situations are SUPPLIERS, CUSTOMERS, MANUFACTURERS in this project. so the user will click on a
TooLBAR button to select customers now.
i can honestly go screw around and eventually get it right but i cant afford it right now
so what im asking is either:
a link to a similar sample,
a step by step walkthrough, not neccessarily code, just the steps.
i will post my code if it is requested.
some of my immediate questions in my quest to finish this project
when do i bind the datasource of the combobox to the dataset?
do i do it at designtime by selecting the properties or do i do it in code when the user presses the CUSTOMERS toolbar
i just set the combobox's datasource to dsCustomers.customers
and the display member to customerID, but when i run the program, and select customers, the combobox is empty
then what do i do in the click event of the combobox?
what event do i use for the combobox to now call the code that fills the textboxes?
how do i tell the textboxes to fill up with the values according to the ID in the combobox?
am i doing it right so far or would it be better to not have everything strongly typed?
would datareaders be brought in at any stage?
once again, im asking a whole bunch.