Skip to content

salmaamr129/LibraryManagementSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Management System

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.

Tech stack

  • C# / Windows Forms
  • .NET Framework 4.7.2
  • SQL Server (LocalDB by default — set up via the included SQL scripts)
  • Visual Studio (the .sln and .csproj open directly)

Features

  • Authentication — Login + Registration forms backed by a users table.
  • 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 columnsdate_insert, date_updated, date_deleted on books for non-destructive removal.

Project layout

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)

Database schema

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.

Running the app

For a guided, copy-pasteable walkthrough — prerequisites, DB setup, verification, and troubleshooting — see PLAYBOOK.md.

Prerequisites

  • 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

Setup

  1. Open LibraryManagementSystem.sln in Visual Studio.
  2. Restore NuGet packages (right-click solution → Restore NuGet Packages).
  3. Create the database. Either:
    • Open SQLQuery2.sql against (localdb)\MSSQLLocalDB and run it, or
    • Run it against any other SQL Server instance after creating a database called LibraryManagementSystem.
  4. 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 in LoginForm.cs, RegisterForm.cs, DataAddBooks.cs, DataIssueBooks.cs, IssueBookscs.cs, ReturnBooks.cs), or refactor to read it from App.config.
  5. Press F5 to build and run.

Known follow-ups

  • Connection string is hardcoded in 6 places — should be centralised in App.config and read via ConfigurationManager.ConnectionStrings.
  • Passwords are stored as plaintext in the users table — production use would require hashing (e.g. PBKDF2 via Rfc2898DeriveBytes).

License

MIT

About

Desktop Library Management System built with C# Windows Forms and SQL Server. Supports book management, member registration, borrow/return tracking, and user login.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages