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. General Programming
  3. Visual Basic
  4. writing function in vb.net

writing function in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpdatabaseoracledata-structures
3 Posts 2 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.
  • C Offline
    C Offline
    chandra_77
    wrote on last edited by
    #1

    Hi, i want help in writing a savefunction in vb.net. requirement is: An array of hat objects is passed into the function. The hat in each object is then saved to the database table.The following properties are set in each hat object :objectID,date,quantity. Table used is hat1 Parameter passed into the function is arrayhat which is an array of hat objects. using .net2.0/vb.net/oracle. Thanks

    D 1 Reply Last reply
    0
    • C chandra_77

      Hi, i want help in writing a savefunction in vb.net. requirement is: An array of hat objects is passed into the function. The hat in each object is then saved to the database table.The following properties are set in each hat object :objectID,date,quantity. Table used is hat1 Parameter passed into the function is arrayhat which is an array of hat objects. using .net2.0/vb.net/oracle. Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      So what's the question? You iterate over the collection of hat objects passed in, get the ID from the object, and check to see if it's in the database. If not, INSERT a new record in the database using the data supplied for that record. If it does exist, UPDATE the existing record. Better yet, this would probably be better suited as a stored procedure in the database. All you would have to do is pass in the 3 parameters to the procedure and it should do the appropriate checks and updates.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        So what's the question? You iterate over the collection of hat objects passed in, get the ID from the object, and check to see if it's in the database. If not, INSERT a new record in the database using the data supplied for that record. If it does exist, UPDATE the existing record. Better yet, this would probably be better suited as a stored procedure in the database. All you would have to do is pass in the 3 parameters to the procedure and it should do the appropriate checks and updates.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        C Offline
        C Offline
        chandra_77
        wrote on last edited by
        #3

        thanks Dave

        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