Posts

Showing posts from 2023

Donate

Contoso University Application Written In ASP.NET Core MVC, Entity Framework Core And .NET 8

Image
Hello, Here's an upgrade of the Contoso University from .NET Core 3.1 to .NET 8. The only major change that I made was seeding the data to the database. The .NET Core 3.1 version used another class to initialize data and the logic was to loop through each the array variable and then add each array element to the DBContext object. After all array records have been added to the context object, call the context's SaveChanges() method. .NET Core 3.1 Seed Data Solution public static class DbInitializer { public static void Initialize(SchoolContext context) { //context.Database.EnsureCreated(); // Look for any students. if (context.Students.Any()) { return ; // DB has been seeded } var students = new Student[] { new Student { FirstMidName = "Carson" , LastName = "Alexander" , Enro...

Windows Forms CRUD (Create/Update/Delete) Application In .NET Core And Visual Basic

Image
Hello, Here's a Visual Basic tutorial on how to create a CRUD (Create/Update/Delete) application using Windows Forms In .NET Core. The same concept is applied to a Windows Forms application in .NET Framework. Most of the concepts and logic were borrowed from the C# version here except that a different programming language is used. First is to create a Students table on your SQL Server Database using the script below. USE [TestDatabase] GO /****** Object: Table [dbo].[Students] Script Date: 03/31/2014 14:11:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Students]( [ID] [int] IDENTITY (1,1) NOT NULL , [Name] [varchar](50) NULL , [Age] [int] NULL , [Address] [varchar](50) NULL , [Contact] [varchar](50) NULL , CONSTRAINT [PK_Students] PRIMARY KEY CLUSTERED ( [ID] ASC ) WITH (PAD_INDEX = OFF , STATISTICS_NORECOMPUTE = OFF , IGNORE_DUP_KEY = OFF , ALLOW_ROW_LOCKS = ON , ALLOW_PAGE_LOCKS = ...

Windows Forms CRUD (Create/Update/Delete) Application In .NET Core And C#

Image
Hello, Here's a simple tutorial on how to create a CRUD (Create/Update/Delete) application using Windows Forms In .NET Core. The same concept is applied to a Windows Forms application in .NET Framework. First is to create a Students table on your SQL Server Database using the script below. USE [TestDatabase] GO /****** Object: Table [dbo].[Students] Script Date: 03/31/2014 14:11:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Students]( [ID] [int] IDENTITY (1,1) NOT NULL , [Name] [varchar](50) NULL , [Age] [int] NULL , [Address] [varchar](50) NULL , [Contact] [varchar](50) NULL , CONSTRAINT [PK_Students] PRIMARY KEY CLUSTERED ( [ID] ASC ) WITH (PAD_INDEX = OFF , STATISTICS_NORECOMPUTE = OFF , IGNORE_DUP_KEY = OFF , ALLOW_ROW_LOCKS = ON , ALLOW_PAGE_LOCKS = ON ) ON [ PRIMARY ] ) ON [ PRIMARY ] GO SET ANSI_PADDING OFF GO Create a Windows Forms App called "CRUDApplicationWi...

Donate