W~C停用

导航

2021年6月4日 #

EF Core中创建DBContext

摘要: 第一步在DAL中创建XXDbContextlei 构造函数为: public EFDbContext(DbContextOptions<EFDbContext> options):base(options) { } 在Startup中注入并配置链接字符串 services.AddDbContext< 阅读全文

posted @ 2021-06-04 15:33 W~C停用 阅读(214) 评论(0) 推荐(0) 编辑

2021年6月3日 #

Core Entity DBFirst

摘要: 1.首先创建一个空的创建一个ASP.NET Core Web 应用 2.引入包,在程序包管理控制台运行命令 Install-Package Microsoft.EntityFrameworkCore.SqlServerInstall-Package Microsoft.EntityFramework 阅读全文

posted @ 2021-06-03 14:18 W~C停用 阅读(24) 评论(0) 推荐(0) 编辑

2021年5月28日 #

根据月份查询

摘要: SELECT * FROM dbo.CheJianSegmentation WHERE CONVERT(VARCHAR(7),AddTime,120)=CONVERT(VARCHAR(7),@AddTime,120) 阅读全文

posted @ 2021-05-28 10:37 W~C停用 阅读(22) 评论(0) 推荐(0) 编辑

2021年5月16日 #

Sql一个简易的登录事务

摘要: use MustGoHome; --判断该事物是否存在,存在就删除 if exists(select * from Sysobjects where name='usp_UserLogin') drop procedure usp_UserLogin; GO--/创建登录事物 create proc 阅读全文

posted @ 2021-05-16 18:43 W~C停用 阅读(84) 评论(0) 推荐(0) 编辑

2021年5月9日 #

一个通用的SQL语句

摘要: if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sys_Page_v2]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo]. 阅读全文

posted @ 2021-05-09 20:04 W~C停用 阅读(71) 评论(0) 推荐(0) 编辑

2021年5月4日 #

关于企业信息的正则表达式

摘要: 企业统一社会信用代码 允许格式: 0123456789012 || 0123456789012-12 /^[^_IOZSVa-z\W]{2}\d{6}[^_IOZSVa-z\W]{10}$/g 企业13位工商注册号: 允许格式:0123456789012 || 0123456789012-12 /[ 阅读全文

posted @ 2021-05-04 03:10 W~C停用 阅读(386) 评论(0) 推荐(0) 编辑

2021年5月3日 #

Sql语句注册公司的事务

摘要: use MustGoHome; --公司注册 if exists(select * from Sysobjects where name='usp_CompanyRegister') drop procedure usp_CompanyRegister; go create procedure us 阅读全文

posted @ 2021-05-03 18:43 W~C停用 阅读(72) 评论(0) 推荐(0) 编辑

2021年4月26日 #

.net Core 获取当前程序路径

摘要: 1.先创建一个类: public static class MyServiceProvider { public static IServiceProvider ServiceProvider { get; set; } } 2.Startup.cs中Configure方法中添加 MyService 阅读全文

posted @ 2021-04-26 22:12 W~C停用 阅读(925) 评论(0) 推荐(0) 编辑

关于C#后端接收前段传来的文件

摘要: 阅读全文

posted @ 2021-04-26 18:09 W~C停用 阅读(301) 评论(0) 推荐(0) 编辑

清除数据库中所有表的数据,不删除表

摘要: declare c cursor for select NAME from sysobjects where xtype='U' declare @t varchar(200) open c fetch next from c into @t while @@FETCH_STATUS=0 begin 阅读全文

posted @ 2021-04-26 14:41 W~C停用 阅读(234) 评论(0) 推荐(0) 编辑