Không biết file sql của em nó bị lỗi chỗ nào. Nhưng khi em viết phần mềm c# lại sử dụng chức năng thêm ở mục "nhân viên" và "điện thoại" không được ạ mọi người. Xin các cao nhân chỉ giáo em ạ. Em mới học lập trình thời gian ngắn nên cũng không rành lắm
đây là sql của em:

create database quanlidoannganhdienthoai542021
go
use quanlidoannganhdienthoai542021
go
create table Taikhoanquanly ( taikhoanql nVarchar(50), matkhauql nVarchar(50),
constraint PK_TK primary key (Taikhoanql));
go
create table taikhoanNhanvien ( taikhoannv nVarchar(50), matkhaunv nVarchar(50),
constraint PK_TK primary key (Taikhoannv));
go
create table Nguoidung ( TaiKhoan nVarchar(50), MatKhau nVarchar(50),
constraint PK_TK primary key (Taikhoan));
go
create table NSX (
Mansx varchar (10), Tennsx nvarchar (50), Xuatxu nvarchar (50), constraint PK_NSXX primary key (Mansx));
go
create table Dienthoai(
MaDT varchar (10), TenDT nvarchar (50), Mansx varchar (10), Soluong nvarchar(50) , Dongianhap nvarchar(50), Dongiaban nvarchar(50),
constraint PK_DT primary key (MaDT));
go
create table Nhanvien(
Manv varchar (10), Tennv nvarchar (50), Gioitinh varchar(10), DCnv nvarchar (50), SDTnv nvarchar(50), Ngaysinh date,
Macv varchar (10), Tglamviec nvarchar(50), Luong nvarchar(50),
constraint PK_NV primary key (Manv);
go
create table Khachhang (
Makh varchar (10), Tenkh nvarchar (50), DCkh nvarchar(50), SDTkh nvarchar(50),
constraint PK_KH primary key (Makh));
go
create table Hoadon(
MaHD varchar (10), Manv varchar (10), Makh varchar (10), Tongtien nvarchar(50),
constraint PK_HD primary key (MaHD));
go
create table ChitietHD (
MaHD varchar (10), MaDT varchar (10), Soluong nvarchar(50), Dongia nvarchar(50), Thanhtien nvarchar(50),
constraint PK_CTHD primary key (MaHD, MaDT));
go
create table Chucvu(
Macv varchar (10), Tencv nvarchar (50), Luongcv nvarchar (50),
constraint PK_CV primary key (Macv));
go
----KN----

ALTER TABLE Dienthoai ADD CONSTRAINT FK_DT_NSXX FOREIGN KEY (Mansx) REFERENCES NSX (Mansx)
ALTER TABLE Nhanvien ADD CONSTRAINT FK_NV_CV FOREIGN KEY (Macv) REFERENCES Chucvu (Macv)
ALTER TABLE Hoadon ADD CONSTRAINT FK_HD_NV FOREIGN KEY (Manv) REFERENCES Nhanvien (Manv)
ALTER TABLE ChitietHD ADD CONSTRAINT FK_CTHD_HD FOREIGN KEY (MaHD) REFERENCES Hoadon (MaHD)

go

---DL---
INSERT INTO Chucvu([Macv],[Tencv],[Luongcv]) VALUES ('CV001',N'Bán hàng','18000')
INSERT INTO Chucvu([Macv],[Tencv],[Luongcv]) VALUES ('CV002',N'Tư vấn','19000')
INSERT INTO Chucvu([Macv],[Tencv],[Luongcv]) VALUES ('CV003',N'Kỹ thuật viên','22000')
INSERT INTO Chucvu([Macv],[Tencv],[Luongcv]) VALUES ('CV004',N'Giao hàng','20000')
go
INSERT INTO Khachhang([Makh],[Tenkh],[DCkh],[SDTkh]) VALUES ('KH001',N'Wowy',N'TP Hồ Chí Minh','0778569942')
INSERT INTO Khachhang([Makh],[Tenkh],[DCkh],[SDTkh]) VALUES ('KH002',N'Karik',N'Tây Ninh','0366749978')
INSERT INTO Khachhang([Makh],[Tenkh],[DCkh],[SDTkh]) VALUES ('KH003',N'Suboi',N'Bến Tre','0784765548')
INSERT INTO Khachhang([Makh],[Tenkh],[DCkh],[SDTkh]) VALUES ('KH004',N'Binz',N'Tiền Giang','0364876652')

go
INSERT INTO NSX( [Mansx], [Tennsx], [Xuatxu]) VALUES ('NSX001','Samsung',N'Hàn Quốc')
INSERT INTO NSX( [Mansx], [Tennsx], [Xuatxu]) VALUES ('NSX002','Oppo',N'Đài Loan')
INSERT INTO NSX( [Mansx], [Tennsx], [Xuatxu]) VALUES ('NSX003','iPhone',N'Mỹ')
INSERT INTO NSX( [Mansx], [Tennsx], [Xuatxu]) VALUES ('NSX004','Xiaomi',N'Trung Quốc')
go
INSERT INTO Dienthoai( [MaDT], [Mansx], [TenDT],[Dongianhap],[Dongiaban],[Soluong]) VALUES ('DT001', 'NSX001', 'Oppo A93','5000000','5500000','5')
INSERT INTO Dienthoai( [MaDT], [Mansx], [TenDT],[Dongianhap],[Dongiaban],[Soluong]) VALUES ('DT002', 'NSX002', 'Xiaomi Blackshark','15000000','15600000','6')
INSERT INTO Dienthoai( [MaDT], [Mansx], [TenDT],[Dongianhap],[Dongiaban],[Soluong]) VALUES ('DT003', 'NSX003', 'Samsung Note 10','25000000','25500000','8')
INSERT INTO Dienthoai( [MaDT], [Mansx], [TenDT],[Dongianhap],[Dongiaban],[Soluong]) VALUES ('DT004', 'NSX004', 'iPhone X','35000000','35500000','4')
go
INSERT INTO Nhanvien( [Manv],[Tennv],[DCnv],[SDTnv],[Gioitinh],[Ngaysinh],[Macv],[Tglamviec],[Luong]) VALUES ('NV001', N'Ngô Lâm Minh Quốc', N'Bến Tre', '0889696969',N'LGBT', '2/14/2000','CV001','30','648000')
INSERT INTO Nhanvien( [Manv],[Tennv],[DCnv],[SDTnv],[Gioitinh],[Ngaysinh],[Macv],[Tglamviec],[Luong]) VALUES ('NV002', N'Nguyễn Hoàng Hải', N'Tiền Giang', '0885784436',N'Nam', '4/15/2000','CV002','35','665000‬')
INSERT INTO Nhanvien( [Manv],[Tennv],[DCnv],[SDTnv],[Gioitinh],[Ngaysinh],[Macv],[Tglamviec],[Luong]) VALUES ('NV003', N'Vũ An Hòa', N'Tiền Giang', '0887824438',N'Nam', '6/19/2000','CV003','32','704000‬')
INSERT INTO Nhanvien( [Manv],[Tennv],[DCnv],[SDTnv],[Gioitinh],[Ngaysinh],[Macv],[Tglamviec],[Luong]) VALUES ('NV004', N'Nguyễn Thị Tường An', N'Tiền Giang', '0885786697',N'Nữ', '8/17/2000','CV004','36','720400‬')
go
INSERT INTO Hoadon([MaHD],[Makh],[Manv],[Tongtien]) VALUES ('HD001', 'KH005', 'NV001','1550000')
INSERT INTO Hoadon([MaHD],[Makh],[Manv],[Tongtien]) VALUES ('HD002', 'KH006', 'NV002','2550000')
INSERT INTO Hoadon([MaHD],[Makh],[Manv],[Tongtien]) VALUES ('HD003', 'KH007', 'NV003','3550000')
INSERT INTO Hoadon([MaHD],[Makh],[Manv],[Tongtien]) VALUES ('HD004', 'KH008', 'NV004','4550000')
go
INSERT INTO ChitietHD([MaHD],[MaDT],[Dongia],[Soluong],[Thanhtien]) VALUES ('HD001','DT008','5500000','1','5500000')
INSERT INTO ChitietHD([MaHD],[MaDT],[Dongia],[Soluong],[Thanhtien]) VALUES ('HD002','DT007','15500000','1','15500000')
INSERT INTO ChitietHD([MaHD],[MaDT],[Dongia],[Soluong],[Thanhtien]) VALUES ('HD003','DT005','25500000','1','25500000')
INSERT INTO ChitietHD([MaHD],[MaDT],[Dongia],[Soluong],[Thanhtien]) VALUES ('HD004','DT006','35500000','1','35500000')
go


SELECT * from Nguoidung
SELECT * from taikhoanNhanvien
SELECT * from Taikhoanquanly
---nhanvien---
select * from Nhanvien
select top 1 Manv from Nhanvien order by Manv desc
select * from Nhanvien where Manv='01'
delete from Nhanvien where Manv='10'
---khachhang---
select * from Khachhang
select top 1 MaKH from Khachhang order by Makh desc
select * from Khachhang where Makh='01'
delete from Khachhang where Makh='10'
---chucvu---
select * from Chucvu
select top 1 Macv from Chucvu order by Macv desc
delete from Chucvu where Macv='10'
---dienthoai---
select * from Dienthoai
select top 1 MaDT from Dienthoai order by MaDT desc
select * from Dienthoai where MaDT='01'
delete from Dienthoai where MaDT='10'
---nsx---
select * from NSX
select top 1 Mansx from NSX order by Mansx desc
delete from NSX where Mansx='10'
---hoadon---
select * from Hoadon
select top 1 MaHD from Hoadon order by MaHD desc
---cthoadon---
select * from ChitietHD
select top 1 MaHD from ChitietHD order by MaHD desc