|
-
Feb 1st, 2024, 07:33 PM
#1
Thread Starter
New Member
[RESOLVED] Scope of Datasets and DataAdapters for SQLite
Greets all,
I am just getting my feet wet again in VS2022 and I decided to take on a project that accesses and updates a SQLite3 database.
I have a simple question about dataset, SQLiteDataAdapter, and dataTable and the scope of these objects when created in a procedure. I decided to forgo the designers since I got into so much trouble with them my last go around, and thought I would use something more lower-level.
So say I have a form with a datagridview on it, and a button I click that fills it with a query result from a table in my SQLite3 database. I already got that working, but now I am trying to find an easy way to process the query results before displaying in a form control. Examples I have seen show instantiating the dataset, datatable, and SQLiteDataAdapter in a procedure. But such objects are something I would like to use across many procedures and functions.
So is it wise and even possible to create these objects globally to be reused and shared? Are they destroyed at the end of a procedure they are created in?
If there is something I am missing here, I'm not asking for it to be done for me. Instead, I would love direction to where I can get a better understanding of the scope and do's and dont's of creating these database interface objects, and the scope to my application as a result.
I hope I was not too vague. I am not necessarily a rookie at this as a whole, but certainly am in this environment.
Thanks for listening!
Last edited by HopWorksEI; Feb 2nd, 2024 at 06:13 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|