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.
Insert, Update, Delete statements...understanding.Why use them?
Page 1 of 1
2 Replies - 2302 Views - Last Post: 01 September 2009 - 10:55 AM
#1
Insert, Update, Delete statements...understanding.
Posted 01 September 2009 - 09:21 AM
Replies To: Insert, Update, Delete statements...understanding.
#2
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.
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.
#3
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!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote







|