Need help,
new to vb, trying to find the code that will allow me to get info from SQL Server on start up, trying to populate a few fields in a small table to allow user to add,delete,update.
NO, have the connection string, already connect to the sql server, but was looking for what you do after the connect, to load the grid. But have since fiddled my way thru that. If i can ask a similar question, is it best to keep the laod grid in a class module or in the form itself as a part of the load.?
There isn't really a best way to do this. In general, however, class modules are good to use when you have code that you're going to reuse in numerous places. Of course, so are procedures.
If you're going to reuse code in different projects, it makes sense to put the code in a class and expose its functionality through methods and properties. If your reused code is limited to the single project, you might want to use classes if you want to reserve the option of making the code reusable through multiple projects. If not, just use procedures.
As an example, I have a dbUtils class that sets up some connection strings, does some standard formatting, handles updates, deletes, and inserts, and so on. I have used it in several different projects.
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.