|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
populating text boxes...in vb.net 2005, i would like to pull up a name from a database (customers) (i
can do this already), then after a name is selected from a combox box, to populate the form's text boxes with with data about that customer. I.E.: if john is selected from the combo, i would like to have his address, city, etc. filled out in the text boxes. I do not want to populate a listbox or datagrid.....I do these easy as pie in Access but i just can not do it in vb..... can you please help....i am embarassed on how long i have spent on this..and just can't get it....wish they had some wizards to create this like they did in access.. thank you in advance......... :>) Hi,
Show quoteHide quote "Bill Brinkworth" <BillBrinkwo***@discussions.microsoft.com> wrote in 1. open "Data Sources window" (menu-data)message news:E60D49AD-2AC0-465D-9217-DBD149D21A9C@microsoft.com... > in vb.net 2005, i would like to pull up a name from a database (customers) > (i > can do this already), then after a name is selected from a combox box, to > populate the form's text boxes with with data about that customer. I.E.: > if > john is selected from the combo, i would like to have his address, city, > etc. > filled out in the text boxes. I do not want to populate a listbox or > datagrid.....I do these easy as pie in Access but i just can not do it in > vb..... can you please help....i am embarassed on how long i have spent on > this..and just can't get it....wish they had some wizards to create this > like > they did in access.. thank you in advance......... :>) 2. create a new Data Source for your DB and Table (Customers) 3. inside "Data Sources window" you should now see your DataSet and DataTable(Customers) 4. next to the Customers table, there should be a dropdown button, click on it, if you don't see a ComboBox then choose customize and check the ComboBox, if you do see a ComboBox then select it. 5. drag the Customers table on the Form, this should place a ComboBox on the Form (and other binding stuff, you may delete the navigator), you can change the field the ComboBox is showing, by changing DisplayMember ( ComboBox properties ). 6. inside the "Data Sources window" you should also see all the fields under the table, so drag any field you want onto the Form. That should do it, but if you don't or can't go this way, then explain (maybe with code) how you're already binding the TextBox. HTH, Greetings I you don't like binding (and a lot of people don't) then the easiest way
I've found is to use SQL to find the customer information from the customer name in the database then fill in the text boxes. This can be put into the combobox.selectedindexchange event. Alternately, you can read the customer name and info into instance of a classs for each customer when you fill in the combobox and add instances of this class to the comboboxfor each item. If you include an override of "ToString" property in the class that returns the customer name, that's what will appear in the combo box. You can then use the combobox selecteditem with a directcast to your class and display the customer info each time the user selects a different customer. -- Show quoteHide quoteDennis in Houston "Bill Brinkworth" wrote: > in vb.net 2005, i would like to pull up a name from a database (customers) (i > can do this already), then after a name is selected from a combox box, to > populate the form's text boxes with with data about that customer. I.E.: if > john is selected from the combo, i would like to have his address, city, etc. > filled out in the text boxes. I do not want to populate a listbox or > datagrid.....I do these easy as pie in Access but i just can not do it in > vb..... can you please help....i am embarassed on how long i have spent on > this..and just can't get it....wish they had some wizards to create this like > they did in access.. thank you in advance......... :>)
Use of delegate
SetWindowsHookEx and VB.NET 2005 A Framework for Datadriven Forms for VB Dot Net XML Comments File Generated Byte Array, Datagrid Simple Example of How to Implement SerialPort Class Problem with setting focus Help w/ 1st File Access Program Design Mode Property Update Help ISO Date Functions |
|||||||||||||||||||||||