- 博客(655)
- 资源 (16)
- 问答 (1)
- 收藏
- 关注
转载 SQL SERVER将多行数据合并成一行
如果startIndex比param1长,则返回空字符串。如果 length 比param1长,则最多删除到param1 中的最后一个字符。将param1中自startIndex(SQL中都是从1开始,而非0)起,删除length个字符,然后用param2替换删掉的字符。如果param1是受支持的字符数据类型,则返回字符数据。如果param1是一个受支持的 binary 数据类型,则返回二进制数据。param1可以是常量、变量,也可以是字符列或二进制数据列。如果结果值大于返回类型支持的最大值,则产生错误。
2023-01-13 18:26:30
29
原创 Cannot create a DbSet for ‘IdentityUserRole<string>‘ because this type is not included in the
因为在ApplicationDbContext中添加了User的Department信息,参考了Roles的实现;只能一步步调整修改,比较修改前后的差异,最终怀疑是UserStore构造问题;后直接改写原来的UserStore,从UserStoreBase继承过来,如下。搜索后的结果并不能解决问题,表象相同可能实质各异。所以UserStore是自己客制化的;结果发现UserRole无法实现;
2022-12-13 15:36:08
115
转载 Using Reflection to Set a Private Property in C#
When testing a class, you often need to assign a value to a property - a property which you wouldn't otherwise want to allow to be set. In this scenario, reflection can be a valuable tool.Reflection is a tool in C# that can be used to access the metadata o
2022-12-07 16:31:40
20
原创 数据库连接复用 MultipleActiveResultSets=true
这样就不怕数据库的连接资源被耗尽了。使用方法很简单,只需要把它加到数据的连接字符串中即可。按上面的顺序执行,发现不管打开多少个ConsoleApplication1.exe,数据库中没有用户或只有一个用户连接着AdventureWorks数据库。再打开一个ConsoleApplication1.exe,发现又会多一个用户连接到AdventureWorks数据库。按F5执行,可以发现已经有一个用户连接到AdventureWorks数据库了。这就是数据库连接复用的好处了。现在把程序的连接字符串改为。
2022-12-02 18:50:22
53
转载 SQL Server: 数据库模式SCHEMA
例如,如果我尝试删除 [Org] 模式,它会给出一个错误,即您无法删除模式,因为对象 GetEmpData正在引用它。例如,假设您创建了一个新模式[Org],并且您希望您的 [HR].[TableA] 从 [HR] 模式移动到 [Org] 模式。例如,以下脚本在不同的模式 [HR]、[Admin] 和 [Fin] 中创建 [TableA]。一旦我们删除或移动了数据库模式中的所有对象,您就可以删除模式。数据库模式可帮助数据库专业人员管理访问,因为您可以控制对用户各自模式的访问,而不是提供对整个数据库的访问。
2022-11-26 10:38:16
302
原创 await SignInManager.PasswordSignInAsync() always results in a failure
ApplicationUser添加了。如果没有设置这2个信息,就无法登录;
2022-11-26 09:10:51
30
转载 Monitoring Redis key events in .NET Core
Some time ago I wrote an article about Reloading the cache automatically once expired is ASP.NET MVC. The piece of code represented in that article is build on top of .NET Framework 4.7.2. It works fine in case you have a single instance of the application
2022-11-23 16:03:29
14
转载 razor page 和 AntiForgeryToken
先来给大家简单介绍下Razor Razor Pages是ASP.NET Core的一项新功能,可以使编页面的编程方案更简单,更高效。hanler=LoginIn这个Url是什么意思,user是我Page下的一个目录,Login是一个页面,LoginIn是页面里面对应的一个方法。至于为什么是LoginIn而不是OnPostLoginInAsync,在文章开头也提到过,这是Rozar的语法限定,不清楚的朋友可以去看下微软的官方文档,写的肯定比我好。解决了之后发现自己之前钻了牛角尖,,,其实还有更简单的方法。
2022-11-06 09:40:02
34
翻译 Clean Architecture with .NET Core: Getting Started
【代码】Clean Architecture with .NET Core: Getting Started。
2022-10-28 09:29:07
27
原创 dapr初试
确认组件文件夹被初始化了init时命令行会创建默认组件文件夹,其中包含YAML文件,定义了状态存储,pub/sub和zipkin等。dapr sidecar将读取这些部件并使用 redis 状态管理和消息,zipkin收集信息。安装最新的 Dapr 运行binaries文件。重启终端后命令行可以查看dapr信息。3)测试使用 Dapr API。2)本地环境初始化dapr。至少3个实例在运行;
2022-10-25 21:37:26
559
原创 python 访问ssl接口失败
conda SSL错误 SSLError("Can\'t connect to HTTPS URL because the SSL module is not available.解决办法
2022-10-19 15:42:52
455
原创 mongodb 数据分析
正常一天 1440个,超过则应算 2880个;Mongodb 文件存储之 GridFs,如果允许最大一天离线1小时,即少60个;
2022-09-15 18:56:24
783
原创 db数据库的一个问题
"Microsoft.Data.SqlClient.SqlException (0x80131904): Arithmetic overflow error converting IDENTITY to data type int.Arithmetic overflow occurred.
2022-08-01 09:28:29
109
转载 Fix “Arithmetic overflow error converting IDENTITY to data type…” in SQL Server
Arithmetic overflow error converting IDENTITY to data type
2022-07-25 13:12:30
75
转载 在 Windows Server 2019 上使用 Docker
安装好docker desktop居然在win server2019上起不来,提示hyperv缺组件,因为win server本身是vmware虚拟出来的,很不解,因为虚拟的unbutn是可以的。大概原因是如下是微软官方的文档如何在win server上使用docker:准备 Windows 操作系统容器 | Microsoft Docs在 Windows 中配置 Docker | Microsoft Docs若要在 Windows Server 上安装 Docker,可以使用由 Microsoft 发布的
2022-06-11 17:28:20
2241
2
转载 Serilog in Windows-Service not writing to logfile
serilog中设置相对路径在window service中不起作用,因为配置了相对路径,实际文件在C:\Windows\System32参考如下改为绝对路径后成功。File Location When Running as a Windows Service is in System32 Directory · Issue #223 · serilog/serilog-sinks-file · GitHub-----I had a very similar issue. In my
2022-05-22 21:09:04
170
转载 How to make a self extracting archive that runs your setup.exe with 7zip -sfx switch
7zip用自压缩创建exe程序
2022-05-12 13:20:50
1144
转载 Blazor 子父控件通信
IntroductionBlazor is a new framework built by Microsoft for creating interactive client-side web UI with .NET codebase. We can write both client-side and server-side code in C#.NET itself. I have already written five articles about Blazor server on C#
2022-05-12 13:19:11
101
原创 postgresql trigger
1)要先创建trigger方法;用new,old代替原来(sqlserver)的inserted等;CREATE OR REPLACE FUNCTION "public"."update_etor_ticket_bianhao"() RETURNS "pg_catalog"."trigger" AS $BODY$declare strdate varchar;strId varchar;sid int;BEGIN -- type your statements heres..
2022-05-12 13:18:38
285
原创 postgresql 使用lo模块扩展更方便操作
安装 lo 模块扩展CREATE EXTENSION lo;测试触发器作用CREATE TABLE image (title text, raster lo);CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image FOR EACH ROW EXECUTE FUNCTION lo_manage(raster);refsPostgreSQL: Documentation: 14: F.20.lo...
2022-05-12 13:17:39
171
原创 postgresql large object 读写
large object是除了jsonb和bytea外的另一种大文件保存方式;创建创建 inv_oid = lo_creat(-1);“-1” 参数创建新的空的大对象,返回oid,SELECT lo_creat(-1);默认PostgreSQL会随机创建一个oid,也可以自己指定一个作为参数.如下是尝试用31321创建大对象SELECT lo_create (31321);打开-- INV_READ = 0x20000-- INV_WRITE = 0x40
2022-05-11 19:10:02
245
转载 Postgres Large Object
Large objects (LOBs) are those data type collections that are created to contain a large amount of data up to a maximum size that ranges from 8 terabytes to 128 terabytes. It mainly depends on the configuration of a database.Why large objects are used in
2022-05-11 15:39:51
86
转载 Configuring environments in .NET console app
对于非asp.net core程序发现环境变量读取始终是Production,配置基本和asp.net core程序一样了,读取的还是Production,参考如下文章才解决。用Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");直接读取环境变量。ASP.NET Core applications are already set up with support for reading configuration fil..
2022-05-09 08:40:13
60
转载 Nextcloud使用OCC命令重置密码
有时因为种种原因忘记了自己ownCloud/Nextcloud的密码。一般来说,可以使用管理员账户来修改密码如果出现了忘记了管理员密码这种糟糕的情况,就只能通过OCC命令或修改数据库的方式来解决了。本文介绍较为方便的使用OCC命令重置密码方式。OCC命令的用法occ命令是ownCloud/Nextcloud的命令行界面。您可以使用occ执行许多常见的服务器操作,例如安装和升级ownCloud/Nextcloud,管理用户,加密,密码,LDAP设置等。一般格式是这样的:sudo -u
2022-05-08 17:02:27
1520
转载 OCC命令给Nextcloud手动添加文件
有时候,直接通过Web页面上传文件并不那么方便,于是有的朋友就直接把文件上传到服务器里,然后拷贝到data目录下,打开ownCloud,却还是之前的文件。这是因为虽然上传了文件,但是ownCloud/Nextcloud的数据库里并没有这个文件的信息。文件信息都被存储在数据库的oc_filecache表中。使用OCC命令更新文件索引。occ有三个用于管理Nextcloud中文件的命令:files files:cleanup #清楚文件缓存 files:s
2022-05-08 16:55:34
946
转载 TypeScript中`import from`和`import require`之间的区别
1)ES6语法2)typescript引用js3)js是否按模块来实现的Difference between node.js require and ES6 import and export - GeeksforGeeksNode.js follows the commonJS module system, and it require to include modules that exist in separate files and for that purpose it has..
2022-05-04 21:56:43
294
转载 多个project共享一个appsetting.json
Sharing appsettings.json configuration files between projects in ASP.NET CoreA pattern that's common for some apps is the need to share settings across multiple projects. For example, imagine you have both an ASP.NET Core RazorPages app and an ASP.NET
2022-04-30 10:05:14
75
振动数据处理分析和特征图谱.ppt
2020-07-30
webinar_natural_frequencies.ppt
2020-07-16
python标准库例子
2011-08-19
Android内核的简单分析 Android 内核
2011-08-19
ADS1.2的经典资料
2008-09-01
android的calendar 和java原生的不一样吗
2015-09-13
TA创建的收藏夹 TA关注的收藏夹
TA关注的人