2 Replies - 3000 Views - Last Post: 01 September 2009 - 10:55 AM Rate Topic: -----

#1 CakeMaker  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 69
  • Joined: 20-August 09

Insert, Update, Delete statements...understanding.

Posted 01 September 2009 - 09:21 AM

Okay, I am looking into adding a database into my program. When I drag a datagridview onto the form, a binding navigator automatically attaches itself. When I run the program, I can Add, Update, and Delete records from there.

Can someone please explain the necessity of making individual Insert, Update, and Delete statements. I understand why you use the query builder for stuff like: From-tblNames/Where-blahblah. But I can't find a simple explanation of why someone would need to write thier own statements when the Binding Navigator automatically creates ones that work.

Is This A Good Question/Topic? 0
  • +

Replies To: Insert, Update, Delete statements...understanding.

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,463
  • Joined: 12-June 08

Re: Insert, Update, Delete statements...understanding.

Posted 01 September 2009 - 10:38 AM

You write your own for a few reasons.

First it separates the logic from the code. If you just need to alter how your 'get' statement works then it's better to do that in the SQL and not have to roll out a new version of your app code. That's maintainability.

Second, while a small insert/select/delete/update is okay in the vb bigger and more complex projects need bigger and more complex procedures. Why have a hundred line select statement with joins and conditions in your vb code when you can run it in SQL for readability and debugging.
Was This Post Helpful? 1
  • +
  • -

#3 CakeMaker  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 69
  • Joined: 20-August 09

Re: Insert, Update, Delete statements...understanding.

Posted 01 September 2009 - 10:55 AM

I knew there was a reason, or it wouldn't even be an option available. Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1