I am very new to vb.net and I want to start down the right path. In the past when I have built applications in VBA I always used unbound controls. Should I use this approach with vb.net or should I go with data binding the controls?
Same here - I think you learn more by using unbound controls as you have to understand the code in order to show/edit/update the data, but that doesn't mean bound controls are bad - it's just personal preference.
One of my considerations with bound verses unbound was to do with record locks. Is there any advantages in bound controls with regards to record locks?
ADO.Net doesn't lock records. It is entirely disconnected. What it will do for you is throw an exception if you are trying to update a database and the underlieing records have changed.
If you want to do active record locking, going unbound and developing your own data layer would be your best bet.
Set up a base data object that handles all of the data interaction. It will handle your locking, then inherit from it for each of your data entities (tables, views, queries, etc). You can use some abstraction to create a great framework so that you only need to write highly specific code in each of your data entity classes. And after you get the structure finalized, you can throw together a class builder to write your code for you.
i use non-updateable bound controls with ado.net for selecting key values or options that change very little. Every data entry that the user can hurt should use unbound controls. Your own validation is always going to be best.
Steve
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.