{"id":15003071,"url":"https://github.com/maharin-afroj/student-information","last_synced_at":"2026-03-27T02:16:52.213Z","repository":{"id":256818349,"uuid":"856524770","full_name":"maharin-afroj/student-information","owner":"maharin-afroj","description":"Basic CRUD application demonstration","archived":false,"fork":false,"pushed_at":"2024-09-18T03:03:28.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T18:50:36.160Z","etag":null,"topics":["csharp","microsoft-sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maharin-afroj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-12T18:10:05.000Z","updated_at":"2024-09-30T12:23:13.000Z","dependencies_parsed_at":"2024-09-18T06:12:09.963Z","dependency_job_id":null,"html_url":"https://github.com/maharin-afroj/student-information","commit_stats":null,"previous_names":["maharin-afroj/student-information"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maharin-afroj/student-information","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maharin-afroj%2Fstudent-information","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maharin-afroj%2Fstudent-information/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maharin-afroj%2Fstudent-information/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maharin-afroj%2Fstudent-information/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maharin-afroj","download_url":"https://codeload.github.com/maharin-afroj/student-information/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maharin-afroj%2Fstudent-information/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31009857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T01:56:05.093Z","status":"online","status_checked_at":"2026-03-27T02:00:08.055Z","response_time":164,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","microsoft-sql-server"],"created_at":"2024-09-24T18:55:40.564Z","updated_at":"2026-03-27T02:16:52.178Z","avatar_url":"https://github.com/maharin-afroj.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Student Information CRUD application\n\n## Project Overview\nThis project demonstrates how to implement CRUD (Create, Read, Update, Delete) operations using C# and SQL Server within a Windows Forms Application. It provides a user-friendly interface for managing student records.\n\n## Table of Contents\n\n## Technologies Used\n- **C#**: Core programming language\n- **.NET Framework/Core**: Application framework\n- **Entity Framework**: ORM for database access\n- **SQL Server** or **SQLite**: Database (choose one based on my project)\n- **Visual Studio**: IDE for development\n\n  ### Prerequisites\n\n- Visual Studio 2022 or later\n- SQL Server (Express or any version)\n- SQL Server Management Studio (SSMS)\n\n\n  ## Features\n\n- **Add New Students**: Users can input student details such as `Student ID`, `Student Name`, and `Age`. When the \"Insert\" button is clicked, the new student is added to the list and the database.\n  \n- **View/Search Student Information**: The application displays all student records in a grid format, showing the student's ID, name, and age.\n\n- **Update Student Information**: Users can select an existing student from the grid and update their details using the \"Update\" button. This will modify the selected student's information in the database.\n\n- **Delete Student Records**: Select a student from the grid and click the \"Delete\" button to remove their record from the system. A confirmation can be implemented to avoid accidental deletions.\n\n- **Search Students**: Users can search for a student by `Student ID`, `Student Name`, or `Age` using the \"Search\" button, and the grid will update to show only the relevant records.\n\n-  **Schema Diagram:**\n\n![Screenshot 2024-09-13 190805](https://github.com/user-attachments/assets/142bb970-c62b-4b6e-b1b9-ca1855ecd717)\n\n  \n\n## Set Up SQL Server Database:\nOpen SQL Server Management Studio (SSMS) and connect to your SQL Server instance.\n\n**Create the Database**:\n\n- Open the `.sql` file located in folder.\n    - Copy the queries from the `.sql` file and execute them in your new database to set up the schema and initial data.\n    - Use `Ctrl+F` to search for `connectionString` within the project files.\n        ```csharp\n       SqlConnection con = new SqlConnection(\"Data Source=DESKTOP-JELVURO;Initial Catalog=CRUD_OPERATION;Integrated Security=True\");;\n    - Update this to:\n        ```csharp\n        private readonly string connectionString = \"Server=\u003cYOUR DATABASE SERVER/SOURCE\u003e;Database=\u003cDATABASENAME\u003e;Trusted_Connection=True;\";\n        \n**Create a Table for Student Information:**\n\nCREATE TABLE Students (\n\n    StudentId INT PRIMARY KEY IDENTITY(1,1),\n    Name NVARCHAR(100) NOT NULL,\n    Age INT NOT NULL\n);\nGO\n\nThis table will store StudentId, Name, and Age.\n\n**Create a C# Windows Forms Application:**\n\n- Open Visual Studio.\n\n**Create a New Project:**\n- Select C# \u003e Windows Forms App (.NET Framework).\n- Choose a project name and location.\n\n**Design Your Form:**\n- Add text boxes for StudentId, Name, and Age.\n- Add buttons for Insert, Update, Delete, and Search.\n- Add a DataGridView to display student records.\n\n**Add SQL Server Connection:**\nTo connect your application to the SQL Server database, you need to configure a connection string.\n\n**Install SQL Server NuGet Package (optional if not already available):**\n\n- In Solution Explorer, right-click on the project and select Manage NuGet Packages.\n- Search for System.Data.SqlClient and install it.\n\n**Set up the Connection String in your C# code:**\nIn your code-behind file (e.g., Form1.cs), define the connection string:\n\n- string connectionString = \"Data Source=YOUR_SERVER_NAME;Initial Catalog=StudentDB;Integrated Security=True;\";\n- Replace (YOUR_SERVER_NAME) with the actual name of your SQL Server (you can find this in SSMS).\n\n### C# Code Implementation\n#### insert data function sample\n```csharp \n private void button1_Click(object sender, EventArgs e)\n {\n  SqlConnection con = new SqlConnection(\"Data Source=DESKTOP-JELVURO;Initial Catalog=CRUD_OPERATION;Integrated Security=True\");\n     con.Open();\n     SqlCommand cmd=new SqlCommand (\"insert into ut values (@id,@name,@age)\",con);\n     cmd.Parameters.AddWithValue(\"@id\", int.Parse(textBox1.Text));\n     cmd.Parameters.AddWithValue(\"@name\", textBox2.Text);\n     cmd.Parameters.AddWithValue(\"@age\", double.Parse(textBox3.Text));\n\n     cmd.ExecuteNonQuery();\n     con.Close();\n\n     MessageBox.Show(\"Succesfully Inserted\");\n     loadData();\n }\n```\n#### Update data function sample\n```csharp \n private void button2_Click_1(object sender, EventArgs e)\n {\n\n     SqlConnection con = new SqlConnection(\"Data Source=DESKTOP-JELVURO;Initial Catalog=CRUD_OPERATION;Integrated Security=True\");\n     con.Open();\n     SqlCommand cmd = new SqlCommand(\"update ut set name=@name,age=@age where id=@id\", con);\n     cmd.Parameters.AddWithValue(\"@id\", int.Parse(textBox1.Text));\n     cmd.Parameters.AddWithValue(\"@name\", textBox2.Text);\n     cmd.Parameters.AddWithValue(\"@age\", double.Parse(textBox3.Text));\n\n     cmd.ExecuteNonQuery();\n     con.Close();\n\n     MessageBox.Show(\"Succesfully Updated\");\n     loadData();\n }\n```\n**Delete Operation**\n```csharp \nprivate void button3_Click(object sender, EventArgs e)\n{\n    SqlConnection con = new SqlConnection(\"Data Source=DESKTOP-JELVURO;Initial Catalog=CRUD_OPERATION;Integrated Security=True\");\n    con.Open();\n    SqlCommand cmd = new SqlCommand(\"delete ut where id=@id\", con);\n    cmd.Parameters.AddWithValue(\"@id\", int.Parse(textBox1.Text));\n\n    cmd.ExecuteNonQuery();\n    con.Close();\n\n    MessageBox.Show(\"Succesfully Delete\");\n    loadData();\n}\n```\n**Search Operation**\n```csharp \n private void button4_Click(object sender, EventArgs e)\n {\n     SqlConnection con = new SqlConnection(\"Data Source=DESKTOP-JELVURO;Initial Catalog=CRUD_OPERATION;Integrated Security=True\");\n     con.Open();\n     SqlCommand cmd = new SqlCommand($\"select * from ut where id like {textBox1.Text.Trim()}\" , con);\n     SqlDataAdapter da   = new SqlDataAdapter(cmd);\n     DataTable dt=new DataTable();\n     da.Fill(dt);\n     dataGridView1.DataSource = dt;\n     \n }\n```\n**Load Data into DataGridView**\nCall this method in the form's Load event to display the data when the application starts.\n```csharp \nprivate void Form1_Load(object sender, EventArgs e)\n{\n    LoadStudents();\n}\n```\n## Screenshots\nBelow is a screenshot of the application interface showing the CRUD operation functionality:\n![Screenshot 2024-09-13 162013](https://github.com/user-attachments/assets/d82d39da-eb02-42e7-9ee3-fe2273128de7)\n\n### Event Handling\n- Implement event handlers for each button (e.g., `Create`, `Edit`, `Delete`).\n- When a button is clicked, the corresponding CRUD operation will be executed (e.g., creating a new record or deleting an existing one).\n\n## User Flow\n1. When the application is opened, existing records are displayed in the `DataGridView`.\n2. Users can:\n   - **Insert**: new records by clicking the \"Insert\" button and submitting the form.\n   - **Delete**: records by selecting a row and confirming deletion.\n   - **Update**: user can update any data from data grid view.\n\n## Challenges and Considerations\n- **Error Handling**: Implement error handling for database connection failures or invalid inputs.\n\n## **Build and Run the Application**:\n    Open the project in Visual Studio, build it, and run the application.\n\n## How to Run the Project\n1. **Clone the Repository**: Clone this repository to your local machine.\n   ```bash\n   git clone https://github.com/maharin-afroj/student-information\n   ```\n2. **Set Up the Database**: Configure your SQL Server or SQLite database and update the connection according to the `script.sql` file.\n3. **Build the Project**: Open the project in Visual Studio and build the solution.\n4. **Run the Application**: Once built, run the application and manage records through the Windows Forms interface.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaharin-afroj%2Fstudent-information","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaharin-afroj%2Fstudent-information","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaharin-afroj%2Fstudent-information/lists"}