Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Best practices to save, edit, insert, view records on a Complex form vb.net

Best practices to save, edit, insert, view records on a Complex form vb.net

Scheduled Pinned Locked Moved Database
helpcsharpdatabasequestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RaveRare
    wrote on last edited by
    #1

    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.

    C 1 Reply Last reply
    0
    • R RaveRare

      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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      R 1 Reply Last reply
      0
      • C Christian Graus

        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 )

        R Offline
        R Offline
        RaveRare
        wrote on last edited by
        #3

        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

        C 1 Reply Last reply
        0
        • R RaveRare

          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

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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 )

          W 1 Reply Last reply
          0
          • C Christian Graus

            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 )

            W Offline
            W Offline
            Widgets
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups