projects / das
┌─ Database app
das
A C# desktop app on SQL Server that adds, edits, deletes and lists records through a data access layer I wrote by hand.
## Summary
The Libreria project: a WinForms app that talks to SQL Server through one data access class (Access), which wraps the connection, the commands and the readers. The Person model handles its own create, update and delete.
## What it shows
- A data access layer on
SqlConnection,SqlCommandandSqlDataReader. - A
Personmodel withInsert,Update,DeleteandList. - IDs generated with
ExecuteScalar. - UI, model and data access kept in separate layers.
## Excerpt
internal class Access
{
private SqlConnection connection;
public void Open() { /* opens the connection */ }
public void Close() { /* closes and disposes it */ }
public int Write(string sql) { /* ExecuteNonQuery */ }
public SqlDataReader Reader(string sql) { /* ExecuteReader */ }
}