目录
配置简介和软件条件
数据库附件配置
vs应用程序web.config配置数据库链接字符串
数据库文件脚本代码
配置简介和软件条件
所需要的软件是Vs2017以上数据库是Sqlserver2012以上,如果数据库附件不了可以使用数据库脚本附件数据库脚本会在文章末尾写出来。可以直接复制到数据库哪里创建TushuManger执行
首先拿到源码后解压文件会得到8个目录,除了文件夹以外另外两个.ldf和.mdf文件是数据库
源码可以直接点击文件夹TuShuManger文件里面的TuShuManger.sln
数据库附件配置
打开sqlerver2019右键数据库哪里选择附件后,添加上对应的数据库.mdf文件
vs应用程序web.config配置数据库链接字符串
打开目录里面的TuShuManger.sln后点击文件web.config,然后配置里面参数,datasource是数据库服务器地址,Initial Catalog是数据库名称
数据库文件脚本代码
USE [TuShuManger]
GO
/****** Object: Table [dbo].[ReaderManger] Script Date: 11/28/2023 20:43:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReaderManger](
[Id] [int] IDENTITY(1,1) NOT NULL,
[rmnum] [nvarchar](max) NULL,
[rmname] [nvarchar](max) NULL,
[rmljnum] [nvarchar](max) NULL,
[rmphone] [nvarchar](max) NULL,
[rmsex] [nvarchar](max) NULL,
[rmsr] [nvarchar](max) NULL,
[rmcatgoryid] [nvarchar](max) NULL,
[rmyx] [nvarchar](max) NULL,
[rmyue] [nvarchar](max) NULL,
[rmbj] [nvarchar](max) NULL,
[rmyxq] [nvarchar](max) NULL,
[rmsfz] [nvarchar](max) NULL,
[rmemail] [nvarchar](max) NULL,
[rmaddress] [nvarchar](max) NULL,
[rmbeiz] [nvarchar](max) NULL,
[idate] [nvarchar](max) NULL,
[xtdate] [datetime] NULL,
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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'读者编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'读者姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmphone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'读者性别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmsex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生日' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmsr'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'读者类别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmcatgoryid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'院系' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmyx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'余额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmyue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'班级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReaderManger', @level2type=N'COLUMN',@level2name=N'rmbj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'有效期' , @level0type=N'SCHEMA',@level0name=N'dbo'