2 Replies - 301 Views - Last Post: 01 April 2013 - 08:02 AM Rate Topic: -----

#1 davers  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 07-April 11

Create class to update large sql database

Posted 01 April 2013 - 07:26 AM

Hey gang. I've developed an app that will update a table that has over 125 columns. That works no problem. However, my code is clunky looking and long because of all the columns I have "hard coded" into my code. I know there HAS to be a better way. I've started reading about using @parameters, which I'm going to do, but is there a way to create a class that has a list of parameters...maybe to a list, that I can call in my code using some kind of "foreach" statement in it? You know, like, for each column in my class, insert..blah blah?

Thanks!

Dave

Is This A Good Question/Topic? 0
  • +

Replies To: Create class to update large sql database

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6076
  • View blog
  • Posts: 23,545
  • Joined: 23-August 08

Re: Create class to update large sql database

Posted 01 April 2013 - 08:02 AM

125 columns means your DB design is almost certainly horrible. There's no getting around that except redesign with correct relational DB principles.
Was This Post Helpful? 0
  • +
  • -

#3 Michael26  Icon User is offline

  • DIC-head, major DIC-head
  • member icon

Reputation: 362
  • View blog
  • Posts: 1,534
  • Joined: 08-April 09

Re: Create class to update large sql database

Posted 01 April 2013 - 08:02 AM

I think you should read about Entity framework and get this book
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1