.NET Code Snippets for VB.NET
Click here to download the VB.NET code snippets for Visual Studio 2005+. These snippets are designed to help quickly and correctly generate the standard plumbing code for DatabaseObject collection and item classes as well as different database connections. Currently, the snippets are only for VB.NET.
Download DatabaseObjectsSnippetsVB.zip
To Install:
- Extract the contents of the zip to C:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033 (this is just the standard location for VB snippet files and can be stored anywhere)
- From Visual Studio, select Tools > Code Snippets Manager
- Select Add and select the folder C:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033\Database Objects
To Use:
- Type the shortcut in the code window (see shortcut list below) and press TAB OR;
- Right click in the code window and select Insert Code Snippet > Database Objects and then the code snippet to insert.
Listed below is a table of shortcuts in the snippets library. To use the snippet just enter the shortcut key and then press the TAB key.
Shortcut | |
dbosqls | Initialises the Database class with an SQL Server connection. |
dbomysql | Initialises the Database class with a MySQL connection. |
dbomsa | Initialises the Database class with a Microsoft Access connection. |
dbol [DatabaseObjectsList] | Creates collection and item classes that respectively represents a database table and table record. |
dbolk [DatabaseObjectsListKeyed] | Creates collection and item classes that respectively represents a database table and table record. The collection includes default/indexer property for the key field that can be used to index into the collection. |
dbomd [DatabaseObjectsMasterDetail] | Creates a master-detail set of classes - two collection and item classes that respectively represents two database tables and records with a master-detail table relationship. |