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. Delete

Delete

Scheduled Pinned Locked Moved ASP.NET
help
5 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.
  • A Offline
    A Offline
    A kamath
    wrote on last edited by
    #1

    I am trying to delete a record using item deleteing event. But it is showing error as null reference exception. Can anybody help please.

    C 1 Reply Last reply
    0
    • A A kamath

      I am trying to delete a record using item deleteing event. But it is showing error as null reference exception. Can anybody help please.

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

      Not based on this. What line gives you the error ? What does your code look like ?

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "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 )

      A 1 Reply Last reply
      0
      • C Christian Graus

        Not based on this. What line gives you the error ? What does your code look like ?

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "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 )

        A Offline
        A Offline
        A kamath
        wrote on last edited by
        #3

        It is inside a details view. I have taken the values inside the details view from session object I have a kept a int to take the datakey value. but this is showing an error int Refno = (int)DetailsView1.DataKey.Value;

        C 1 Reply Last reply
        0
        • A A kamath

          It is inside a details view. I have taken the values inside the details view from session object I have a kept a int to take the datakey value. but this is showing an error int Refno = (int)DetailsView1.DataKey.Value;

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

          and does the debugger tell you that one or more of these values are null, or Value is not an int ? Does Convert.ToInt32, or int.TryParse do better than straight cast ?

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "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 )

          A 1 Reply Last reply
          0
          • C Christian Graus

            and does the debugger tell you that one or more of these values are null, or Value is not an int ? Does Convert.ToInt32, or int.TryParse do better than straight cast ?

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "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 )

            A Offline
            A Offline
            A kamath
            wrote on last edited by
            #5

            It is showing error like this NullReferenceException: Object reference not set to an instance of an object. at Details.DetailsView1_ItemDeleting(Object sender, DetailsViewDeleteEventArgs e)

            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