Snippets

Insert

Edit / IntelliSense / Insert Snippet
Ctrl + k, ctrl + x

Manage

Tools / Code Snippets Manager
Ctrl + k, ctrl + b

Structure

Datagridview

Handle grid - dgvHandle
This snippet handles:
- Selectionchanged event of the grid to set the details
- Click on button New to generate a new item
- Click on button Edit to edit the selected item
- Click on button Delete to delete the selected item
- Click on button Cancel to cancel the started action
Requirements:
A datatgridview with name dgv$Object$.
Two bindingsources: bs$Object$Grid and bs$Object$Detail.
Four buttons: btn$Object$New, btn$Object$Edit, btn$Object$Delete and btn$Object$Cancel
The texts on this buttons should be: 'New', 'Edit' and 'Delete'.
Routines for inserting, updating and deleting the object: $Object$.Insert($Object$), $Object$.Update($Object$) and $Object$.Delete($Object$)

Linq

Get all records - linga
Get record by id - lingid
Insert - linins
Update - linupd

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License