12/16/2023 0 Comments Sqlite database reader![]() There are so many things wrong with this approach: the "open" method does a select which creates a DataReader on the connection, rendering the connection unusable until the reader is closed - and since the "outside world" can't access the reader at all, the connection can't be used anyway. 'On Top' of that layer, you then build Module(s) that are specific to the data you wish to handle - One Module per database or table maybeĭoes this help or get you any closer to what you need ? at the bottom-most layer, you have a sqlite database module that does only low level things with ANY database. ġ) ModuleOne is a bad name and not indicative of it's purpose - vs 'sqliteDBModule' for example (I forget the VB 'case' conventions)Ģ) openDB does too much - it should take maybe the name/path to the db, and return a db connection or error (or even throw an exception), that's it - one purposeģ) you could extend your Sqlite 'Module' to implement openDB, closeDB, executeSQL etc etc, but of course I'd say consider what's out there already and re-use/extend itĤ) in addition to (3), I'd say, think of 'layering'/'abstractions'. if you want a quick critique on 'ModuleOne', ok. In general, yes, it should be possible - take a look here for example. ![]() You Said "this is not working so well" - could you please use Improve question to indicate 'why not' - it may help people know what you need, it is not clear to me exactly what you're asking for ' To Set Col Header Default Cell Styles DO in PropertiesĭgvOne.Columns( 0).SortMode = DataGridViewColumnSortMode.NotSortableĭgvOne.Columns( 1).SortMode = DataGridViewColumnSortMode.NotSortable ![]() Dim conn As New SQLiteConnection( " Data Source =" & dbName & " Version=3 ")ĭim valuesList As ArrayList = New ArrayList()ĭim cmd As SQLiteCommand = New SQLiteCommand( " Select * FROM ParentTable", conn)ĭim rdr As SQLite.SQLiteDataReader = cmd.ExecuteReaderĭ = New Font("Tahoma", 10) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |