ADO.NET Core
Basics of ADO.NET
Basics of ADO.NET
  • Concepts
    • Database tools overview
      • SSMS & VS Data tools
    • ADO.NET Basics
  • Code
    • Connected mode
      • Create the database
      • Create project
      • Read data
      • Insert data
    • Disconnected mode
      • Create project
      • Read data
      • Insert data
    • GitHub Repo
  • Optional
    • WinForms walkthrough MS
    • Northwind DB
Powered by GitBook
On this page
  • Create the database
  • Verify creation
  1. Code
  2. Connected mode

Create the database

Create the database

Let us create a database called StudentDB along with a Student table using Visual Studio or SSMS

USE master;
GO

CREATE DATABASE StudentDB;
GO

USE StudentDB;
GO

CREATE TABLE Student(
 Id INT PRIMARY KEY,
 Name VARCHAR(100),
 Email VARCHAR(50),
 Mobile VARCHAR(50)
)
GO

INSERT INTO Student VALUES (101, 'Anurag', 'Anurag@dotnettutorial.net', '1234567890')
INSERT INTO Student VALUES (102, 'Priyanka', 'Priyanka@dotnettutorial.net', '2233445566')
INSERT INTO Student VALUES (103, 'Preety', 'Preety@dotnettutorial.net', '6655443322')
INSERT INTO Student VALUES (104, 'Sambit', 'Sambit@dotnettutorial.net', '9876543210')
GO

Verify creation

We could use a select query to verify if the data has been created

PreviousConnected modeNextCreate project

Last updated 2 years ago