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. SAVE DATA program in VB.NET

SAVE DATA program in VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasequestion
3 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.
  • A Offline
    A Offline
    Ahmad Rifai Yusuf
    wrote on last edited by
    #1

    Please any body who might give an opinion about my Save Data ..! MsgBox("Is Data Correctly Right ?", MsgBoxStyle.YesNo, "Confirmation") If MsgBoxResult.Yes Then drcustoms = dtcustoms.NewRow drcustoms("cstcd") = txtcstcd.text drcustoms("cstnm") = txtcstnm.text drcustoms("cstadrs") = txtcstadrs.text drcustoms("cstphno") = txtcstphno.text conn.Open endif the procedure is after the message box appear and the answer is "Yes" the field should save in the database, if the answer is "No" abort the save. I'am the new bies and interesting in VB.NET programming. Please give an opnion if any body know the right and the simple code program. Best Regards, Ahmad Rifai Yusuf

    D H 2 Replies Last reply
    0
    • A Ahmad Rifai Yusuf

      Please any body who might give an opinion about my Save Data ..! MsgBox("Is Data Correctly Right ?", MsgBoxStyle.YesNo, "Confirmation") If MsgBoxResult.Yes Then drcustoms = dtcustoms.NewRow drcustoms("cstcd") = txtcstcd.text drcustoms("cstnm") = txtcstnm.text drcustoms("cstadrs") = txtcstadrs.text drcustoms("cstphno") = txtcstphno.text conn.Open endif the procedure is after the message box appear and the answer is "Yes" the field should save in the database, if the answer is "No" abort the save. I'am the new bies and interesting in VB.NET programming. Please give an opnion if any body know the right and the simple code program. Best Regards, Ahmad Rifai Yusuf

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

      Without seeing the rest of your code, like what's drcustoms, dtcustoms, and what the rest of that conn object looks like, it's very difficult to tell you what your doing wrong. I can tell your that you set the values of a bunch of fields, then opened a connection to a database, but you DIDN'T execute any proecure to write that information to the database, nor did you close the connection to it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • A Ahmad Rifai Yusuf

        Please any body who might give an opinion about my Save Data ..! MsgBox("Is Data Correctly Right ?", MsgBoxStyle.YesNo, "Confirmation") If MsgBoxResult.Yes Then drcustoms = dtcustoms.NewRow drcustoms("cstcd") = txtcstcd.text drcustoms("cstnm") = txtcstnm.text drcustoms("cstadrs") = txtcstadrs.text drcustoms("cstphno") = txtcstphno.text conn.Open endif the procedure is after the message box appear and the answer is "Yes" the field should save in the database, if the answer is "No" abort the save. I'am the new bies and interesting in VB.NET programming. Please give an opnion if any body know the right and the simple code program. Best Regards, Ahmad Rifai Yusuf

        H Offline
        H Offline
        HiltonG
        wrote on last edited by
        #3

        First of all, try something like "Is the data correct?". secondly, you will need to add drcustoms("cstphno") = txtcstphno.text --> dtcustoms.rows.add(drcustoms) finally, this will just be storing the data in a disconnected datatable. To send the data back to the database, you will need to a)create a database command, build a sql string (or preferably use a stored procedure) execute the command or b) use the Update method of a dataAdapter Visit my .Net blog at http://hiltong.blogspot.com

        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