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. Other Discussions
  3. The Weird and The Wonderful
  4. SELECT * + datareader.getstring(0...100) = Nightmare

SELECT * + datareader.getstring(0...100) = Nightmare

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasedesignhelptutoriallearning
4 Posts 3 Posters 2 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.
  • D Offline
    D Offline
    Dave Herren
    wrote on last edited by
    #1

    Someone just gave a database example on the forum using select * and I needed to drop in here and do a brief rant. I realize it was just an example and was unrelated to what they were showing, but still... I just got through fixing an application where this caused problems. I needed to make a small change to the application which required me to to add a few database columns. I added the columns in between related columns in the table. This of coarse broke everything because in addition to select * they also used datareader.getstring(0) ect. for the 60+ fields returned from the table. My additions put the columns in a new order when retrieved with select *. Of course this wasn't the only problem... the whole thing was a nightmare. MS access backend, which of course means tons of bad inline sql (not paramitized). One big God class that handled everything and no database layer. Every small change I made broke 5 unrelated things. I ended up refactoring the whole thing. I pulled out related functionality into static helper classes, bad coding practice I know, but there wasn't time for proper class design. But I did implement some interfaces and decoupled significant sections of the code so that I could make changes without breaking everything. Any way that's my coding horror rant... thanks I feel better.

    topcoderjax - Remember, Google is your friend.

    P J 2 Replies Last reply
    0
    • D Dave Herren

      Someone just gave a database example on the forum using select * and I needed to drop in here and do a brief rant. I realize it was just an example and was unrelated to what they were showing, but still... I just got through fixing an application where this caused problems. I needed to make a small change to the application which required me to to add a few database columns. I added the columns in between related columns in the table. This of coarse broke everything because in addition to select * they also used datareader.getstring(0) ect. for the 60+ fields returned from the table. My additions put the columns in a new order when retrieved with select *. Of course this wasn't the only problem... the whole thing was a nightmare. MS access backend, which of course means tons of bad inline sql (not paramitized). One big God class that handled everything and no database layer. Every small change I made broke 5 unrelated things. I ended up refactoring the whole thing. I pulled out related functionality into static helper classes, bad coding practice I know, but there wasn't time for proper class design. But I did implement some interfaces and decoupled significant sections of the code so that I could make changes without breaking everything. Any way that's my coding horror rant... thanks I feel better.

      topcoderjax - Remember, Google is your friend.

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Ohhhhh, so it's your fault. :-D

      D 1 Reply Last reply
      0
      • P PIEBALDconsult

        Ohhhhh, so it's your fault. :-D

        D Offline
        D Offline
        Dave Herren
        wrote on last edited by
        #3

        PIEBALDconsult wrote:

        Ohhhhh, so it's your fault.

        Almost always is... still haven't quite figured out how, but I've come to accept it. :sigh:

        topcoderjax - Remember, Google is your friend. Try this Custom Google Code Search

        1 Reply Last reply
        0
        • D Dave Herren

          Someone just gave a database example on the forum using select * and I needed to drop in here and do a brief rant. I realize it was just an example and was unrelated to what they were showing, but still... I just got through fixing an application where this caused problems. I needed to make a small change to the application which required me to to add a few database columns. I added the columns in between related columns in the table. This of coarse broke everything because in addition to select * they also used datareader.getstring(0) ect. for the 60+ fields returned from the table. My additions put the columns in a new order when retrieved with select *. Of course this wasn't the only problem... the whole thing was a nightmare. MS access backend, which of course means tons of bad inline sql (not paramitized). One big God class that handled everything and no database layer. Every small change I made broke 5 unrelated things. I ended up refactoring the whole thing. I pulled out related functionality into static helper classes, bad coding practice I know, but there wasn't time for proper class design. But I did implement some interfaces and decoupled significant sections of the code so that I could make changes without breaking everything. Any way that's my coding horror rant... thanks I feel better.

          topcoderjax - Remember, Google is your friend.

          J Offline
          J Offline
          John R Shaw
          wrote on last edited by
          #4

          I know this routine… decipher, decouple, rewrite (portions), and etcetera. Then may be you can make a minor change without breaking something else. Remember this mantra: “Life is wonderful”, just keep repeating through your gritted teeth until your jaw unclenches and you can concentrate once more.

          INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

          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