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. having a problem using addnew method

having a problem using addnew method

Scheduled Pinned Locked Moved Visual Basic
helpquestionlearning
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.
  • V Offline
    V Offline
    vaiology
    wrote on last edited by
    #1

    i'm having a hard time figuring out where did i go wrong with this code. Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click 'Begin Add operation -- Enable textboxes and 'disable buttons EnableControls(True) SetButtons(False) 'Add a new blank row to the dataset Me.BindingContext(DsCourse1, "Course").AddNew() 'Set the focus to the first textbox txtCourseID.Focus() End Sub is there something wrong with the syntax of the addnew method? coz it doesn't work :(( can somebody help me please thanks in advance guys!

    N 1 Reply Last reply
    0
    • V vaiology

      i'm having a hard time figuring out where did i go wrong with this code. Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click 'Begin Add operation -- Enable textboxes and 'disable buttons EnableControls(True) SetButtons(False) 'Add a new blank row to the dataset Me.BindingContext(DsCourse1, "Course").AddNew() 'Set the focus to the first textbox txtCourseID.Focus() End Sub is there something wrong with the syntax of the addnew method? coz it doesn't work :(( can somebody help me please thanks in advance guys!

      N Offline
      N Offline
      numbrel
      wrote on last edited by
      #2

      In what way doesn't it work? Do you also have a button or someother way to invoke Me.BindingContext(DsCourse1, "Course").EndCurrentEdit() after you have entered all your information to save the changes and end the edit?

      V 1 Reply Last reply
      0
      • N numbrel

        In what way doesn't it work? Do you also have a button or someother way to invoke Me.BindingContext(DsCourse1, "Course").EndCurrentEdit() after you have entered all your information to save the changes and end the edit?

        V Offline
        V Offline
        vaiology
        wrote on last edited by
        #3

        i have resolved the problem, it's the textbox that i use for the birthdate has the problem i've tried this code which changes the date format into mm/dd/yyyy instead of mm/dd/yyyy hh:mm:ss of the text box displaying date and time from the database http://www.codeproject.com/vb/net/databindingconcepts.asp[^] this is where i got it and it doesn't work maybe it's just me but it's all ok now http://www.codeproject.com/vb/net/databindingconcepts.asp"

        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