A desktop Library Management System built with C# (Windows Forms) on .NET Framework 4.7.2 and backed by SQL Server. Supports librarian workflows: registering members, cataloguing books, issuing and returning books, and tracking inventory state.
- C# / Windows Forms
- .NET Framework 4.7.2
- SQL Server (LocalDB by default — set up via the included SQL scripts)
- Visual Studio (the
.slnand.csprojopen directly)
- Authentication — Login + Registration forms backed by a
userstable. - Dashboard — Landing screen with the library's branding and quick access to actions.
- Add Books — Capture title, author, publication year, and a cover image.
- Issue Books — Assign a book to a member; records contact info, issue date, and expected return date.
- Return Books — Mark a previously-issued book as returned; updates inventory status.
- Soft delete / audit columns —
date_insert,date_updated,date_deletedon books for non-destructive removal.
LibraryManagementSystem.sln Visual Studio solution
LibraryManagementSystem.csproj Project file (.NET Framework 4.7.2)
App.config .NET runtime config (currently minimal)
LoginForm.cs / .Designer.cs Login screen (username/password)
RegisterForm.cs / .Designer.cs Sign-up screen for new librarians
MainForm.cs / .Designer.cs Shell + side navigation
Dashboard.cs / .Designer.cs Branded landing screen
AddBooks.cs / .Designer.cs Form to add a new book
IssueBookscs.cs / .Designer.cs Form to issue a book to a member
ReturnBooks.cs / .Designer.cs Form to record a returned book
DataAddBooks.cs Data-access helper for AddBooks form
DataIssueBooks.cs Data-access helper for IssueBooks form
Properties/ AssemblyInfo + designer resources
Resources/ PNG icons used in the UI
SQLQuery1.sql, SQLQuery2.sql Database schema (see Database setup)
Three tables: users, books, issue_books.
CREATE TABLE users (
id INT PRIMARY KEY IDENTITY(1,1),
email NVARCHAR(100),
username NVARCHAR(50),
password NVARCHAR(100),
date_register DATE
);
CREATE TABLE books (
id INT PRIMARY KEY IDENTITY(1,1),
book_title VARCHAR(100),
author VARCHAR(100),
published DATE,
status VARCHAR(50),
image VARCHAR(50),
date_insert DATETIME DEFAULT GETDATE(),
date_updated DATETIME NULL,
date_deleted DATETIME NULL
);
CREATE TABLE issue_books (
id INT PRIMARY KEY IDENTITY(1,1),
issue_id INT,
full_name VARCHAR(100),
contact VARCHAR(50),
email VARCHAR(100),
book_title VARCHAR(100),
author VARCHAR(100),
image VARCHAR(100),
issue_date DATE,
return_date DATE,
status VARCHAR(50),
date_insert DATETIME,
date_update DATETIME,
date_deleted DATETIME
);The full DDL is in SQLQuery2.sql. SQLQuery1.sql contains the
incremental script used to evolve the schema during development.
For a guided, copy-pasteable walkthrough — prerequisites, DB setup, verification, and troubleshooting — see PLAYBOOK.md.
- Windows + Visual Studio 2019 or newer (with the .NET Desktop development workload)
- .NET Framework 4.7.2 (ships with Windows 10+)
- SQL Server LocalDB (installed by Visual Studio) or any reachable SQL Server instance
- Open
LibraryManagementSystem.slnin Visual Studio. - Restore NuGet packages (right-click solution → Restore NuGet Packages).
- Create the database. Either:
- Open
SQLQuery2.sqlagainst(localdb)\MSSQLLocalDBand run it, or - Run it against any other SQL Server instance after creating a
database called
LibraryManagementSystem.
- Open
- The forms' hardcoded connection string assumes
Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=LibraryManagementSystem. If you use a different server / DB name, search-and-replace the connection string across the source files (it appears inLoginForm.cs,RegisterForm.cs,DataAddBooks.cs,DataIssueBooks.cs,IssueBookscs.cs,ReturnBooks.cs), or refactor to read it fromApp.config. - Press F5 to build and run.
- Connection string is hardcoded in 6 places — should be centralised in
App.configand read viaConfigurationManager.ConnectionStrings. - Passwords are stored as plaintext in the
userstable — production use would require hashing (e.g. PBKDF2 viaRfc2898DeriveBytes).