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. The Lounge
  3. This cracked me up

This cracked me up

Scheduled Pinned Locked Moved The Lounge
csharpasp-netdebuggingtutorialannouncement
6 Posts 6 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.
  • R Offline
    R Offline
    Rama Krishna Vavilala
    wrote on last edited by
    #1

    I am developing a custom ASP.NET data source control and looking at the documentation to see what methods I need to override. Looking at the ExecuteUpdate method the documentation. I find this: _The following code example demonstrates how a class that extends the DataSourceView class can override the CanUpdate property and the ExecuteUpdate method. This code example is part of a larger example provided for the DataSourceView class. C#

    // The CsvDataSourceView does not currently
    // permit update operations. You can modify or
    // extend this sample to do so.
    public override bool CanUpdate {
    get {
    return false;
    }
    }
    protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
    {
    throw new NotSupportedException();
    }


    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

    _

    D J 2 Replies Last reply
    0
    • R Rama Krishna Vavilala

      I am developing a custom ASP.NET data source control and looking at the documentation to see what methods I need to override. Looking at the ExecuteUpdate method the documentation. I find this: _The following code example demonstrates how a class that extends the DataSourceView class can override the CanUpdate property and the ExecuteUpdate method. This code example is part of a larger example provided for the DataSourceView class. C#

      // The CsvDataSourceView does not currently
      // permit update operations. You can modify or
      // extend this sample to do so.
      public override bool CanUpdate {
      get {
      return false;
      }
      }
      protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
      {
      throw new NotSupportedException();
      }


      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

      _

      D Offline
      D Offline
      David Stone
      wrote on last edited by
      #2

      Helpful. :rolleyes:

      Once you wanted revolution
      Now you're the institution
      How's it feel to be the man?

      1 Reply Last reply
      0
      • R Rama Krishna Vavilala

        I am developing a custom ASP.NET data source control and looking at the documentation to see what methods I need to override. Looking at the ExecuteUpdate method the documentation. I find this: _The following code example demonstrates how a class that extends the DataSourceView class can override the CanUpdate property and the ExecuteUpdate method. This code example is part of a larger example provided for the DataSourceView class. C#

        // The CsvDataSourceView does not currently
        // permit update operations. You can modify or
        // extend this sample to do so.
        public override bool CanUpdate {
        get {
        return false;
        }
        }
        protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
        {
        throw new NotSupportedException();
        }


        Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan

        _

        J Offline
        J Offline
        Josh Martin
        wrote on last edited by
        #3

        I guess I'm just incredibly dense today, but what is so funny? The code does exactly what the description says (demonstrates ohw you can override the property and method), and the comments explain why the methods just return false and throw a NotSupportedException (the extended class CsvDataSrouceView doesn't permit it).

        Josh Insert witty sig here

        C 1 Reply Last reply
        0
        • J Josh Martin

          I guess I'm just incredibly dense today, but what is so funny? The code does exactly what the description says (demonstrates ohw you can override the property and method), and the comments explain why the methods just return false and throw a NotSupportedException (the extended class CsvDataSrouceView doesn't permit it).

          Josh Insert witty sig here

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

          I guess we're all still hoping that most developers would find no value in a sample that does nothing.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          J R 2 Replies Last reply
          0
          • C Christian Graus

            I guess we're all still hoping that most developers would find no value in a sample that does nothing.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            J Offline
            J Offline
            Jorgen Sigvardsson
            wrote on last edited by
            #5

            It clearly demonstrates how to write boiler plate code. ;)

            -- Simulcast on Crazy People's Fillings

            1 Reply Last reply
            0
            • C Christian Graus

              I guess we're all still hoping that most developers would find no value in a sample that does nothing.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

              R Offline
              R Offline
              Ranjan Banerji
              wrote on last edited by
              #6

              I thought it was elegant code. It does nothing hence no bugs :-D

              My pointless rants meragussa.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