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. Web Development
  3. ASP.NET
  4. Catch "New Record" in Detailsview.

Catch "New Record" in Detailsview.

Scheduled Pinned Locked Moved ASP.NET
databasequestionhelp
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.
  • J Offline
    J Offline
    japel
    wrote on last edited by
    #1

    Ok I have an Access DB and access it through the Detailsview control. One of the fields in my database is myID which is set in access to autonumber. In the Detailsview control "myID" field has been added as read only. When I press "New" to insert a new record the detailsview enters edit mode. Problem: myID field does not show, can set "visibleoninsert" to TRUE How do I enter a new record a new record and have the autonumber incremented for me??? I thought I would check the MAX number and add 1 then right back but to do this I need to catch the New Event. Any Ideas???

    When people make you see red, be thankful your not colour blind.

    M 1 Reply Last reply
    0
    • J japel

      Ok I have an Access DB and access it through the Detailsview control. One of the fields in my database is myID which is set in access to autonumber. In the Detailsview control "myID" field has been added as read only. When I press "New" to insert a new record the detailsview enters edit mode. Problem: myID field does not show, can set "visibleoninsert" to TRUE How do I enter a new record a new record and have the autonumber incremented for me??? I thought I would check the MAX number and add 1 then right back but to do this I need to catch the New Event. Any Ideas???

      When people make you see red, be thankful your not colour blind.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      If the myId is an auto-number column then you don't need to specify in the insert mode when you want to create a new row. That also means, you do not need to have a field to input for this value in the insert form.

      J 1 Reply Last reply
      0
      • M minhpc_bk

        If the myId is an auto-number column then you don't need to specify in the insert mode when you want to create a new row. That also means, you do not need to have a field to input for this value in the insert form.

        J Offline
        J Offline
        japel
        wrote on last edited by
        #3

        If that was the case it would not error on insert... Unless I enter the next numbrt it fails... I will look into it further... Thanks

        When people make you see red, be thankful your not colour blind.

        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