Best practices to save, edit, insert, view records on a Complex form vb.net
-
Dear every one... Hope you all will be fine and read this in good of your health. I have a problem that what is the best way to save, edit, insert, update etc. my record using a complex form. PICTURE IS THIS; I have a form Students.VB I have many controls on the form as under Listboxes Textboxes Checkboxes buttons now i want to know following things.... 1. How i will fill my listbox with Student Names using data reader object (Database School is in MS ACCESS and table Student with fields ID,NAME,AGE) 2. how i will fill my comboboxes with CITIES, STATES, COUNTRIES etc. 3. what is the alternate of listbox.itemdata property in vb.net etc. etc. etc.. please give me a detailed help that can clear my concept.
-
Dear every one... Hope you all will be fine and read this in good of your health. I have a problem that what is the best way to save, edit, insert, update etc. my record using a complex form. PICTURE IS THIS; I have a form Students.VB I have many controls on the form as under Listboxes Textboxes Checkboxes buttons now i want to know following things.... 1. How i will fill my listbox with Student Names using data reader object (Database School is in MS ACCESS and table Student with fields ID,NAME,AGE) 2. how i will fill my comboboxes with CITIES, STATES, COUNTRIES etc. 3. what is the alternate of listbox.itemdata property in vb.net etc. etc. etc.. please give me a detailed help that can clear my concept.
in all cases, the answer is the datasource property of hte controls, which will take a datatable, a dataview, an array, you name it
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
in all cases, the answer is the datasource property of hte controls, which will take a datatable, a dataview, an array, you name it
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
dear friend. thanks for information. its ok in all senses i have build. then tell me that if i have a combo box filled with Brand names and behind the scene i am saving the Brand ID for each brand name. in vb 6, i used dataitem property of combobox to save a brandid with every brand name, now what i should do with the same contol thanks
-
dear friend. thanks for information. its ok in all senses i have build. then tell me that if i have a combo box filled with Brand names and behind the scene i am saving the Brand ID for each brand name. in vb 6, i used dataitem property of combobox to save a brandid with every brand name, now what i should do with the same contol thanks
Use the DisplayProperty and DataProperty properties ( from memory ) to set a displayed and a hidden value. This will not store them in the DB, but it will load them from the DB for you to use with the control.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Use the DisplayProperty and DataProperty properties ( from memory ) to set a displayed and a hidden value. This will not store them in the DB, but it will load them from the DB for you to use with the control.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
You may also set your combobox datasource to datable... and set its displaymember and valuemember.... ComboBox1.Datasource = Dataset.Table("DataTable Name") ComboBox1.ValueMember = "Field Name" -----> Hidden Value ComboBox1.DisplayMember = "Field Name" -----> Visible Value