- 博客(124)
- 资源 (3)
- 收藏
- 关注
转载 Table ‘XXX’ already exists错误解决方法
普通的数据库迁移执行三条命令(0)Enable-Migrations(打开数据迁移)(1)Add-Migration InitialCreate(2) Update-Database -Verbose(自动迁移只需要执行这个)如果只是修改了字段,执行这些命令会提示Table ‘XXXXXXXXXXXXXXXXXXX’ already exists表示这个迁移会执行建表操作,已存在导致迁移失败。楼主解决方法如下:输入 get-help entityframeworkcore获取指令帮助。使
2022-05-05 14:04:47
21053
原创 Fatal error: Uncaught --> Smarty: unable to write file
多是文件权限问题chmod -R 777 该文件夹下所有文件
2022-01-26 23:37:49
808
原创 CS1503 参数 2: 无法从“string”转换为“Microsoft.EntityFrameworkCore.ServerVersion” EF Mysql
2021-12-10 11:35:23
2641
1
原创 lambda GroupBy分组后再查询
var attendanceanddateList = attendanceList.Where(s => s.ProjectID == ProjictID).GroupBy(s => s.EnterArenaDate.ToString(“D”)).Select(s => new { name = s.Key, va=s.Where(c=>c.EnterArenaTemperature>37.2||c.EntranceTemperature>37.2).Select(z=
2021-07-13 16:14:44
1006
原创 EF Core 数据库先行 生成实体类
Scaffold-DbContext -Force “Data Source=xxx.xxx.xxx.xxx; Initial Catalog=asss; Pooling=True; UID=sa;PWD=123456;connect Timeout=10” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models/DataModels
2021-07-06 17:19:16
304
原创 Devexpress Gridcontrol 合并行,列头
<dxg:GridControl Background="#008080" Name=“Homegrid” Margin=“0,31,0,0” DockPanel.Dock=“top” Grid.ColumnSpan=“1” ShowBorder=“False” Height=“auto” FontSize=“15” Width=“auto” > <!--<dxg:GridControl.Columns>--> &l
2021-01-07 13:20:45
913
转载 文件Bitmap之间的转换
String filePath=“c:/01.jpg”;Bitmap bitmap=BitmapFactory.decodeFile(filePath);如果图片过大,可能导致Bitmap对象装不下图片解决办法:String filePath=“c:/01.jpg”;Bitmap bitmap=BitmapFactory.decodeFile(filePath,getBitmapOption(2)); //将图片的长和宽缩小味原来的1/2private Options getBitmapOpti
2020-12-02 10:36:46
640
原创 ServiceStack.Redis.RedisResponseException:“Zero length response”
using ( RedisClient redisClientt = new RedisClient(“192.168.1.28”, 6379)){操作}写进using 里
2020-09-26 10:32:07
787
原创 wpf删除确认 MessageBox.Show
MessageBoxResult dr = MessageBox.Show(“确定要删除吗?,删除后不可恢复”, “提示”, MessageBoxButton.OKCancel, MessageBoxImage.Question);if (dr == MessageBoxResult.OK){//添加一些操作}
2020-09-18 13:50:11
702
转载 sqlserver进程死锁关闭的方法
1.首先我们需要判断是哪个用户锁住了哪张表.123–查询被锁表select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableNamefrom sys.dm_tran_locks where resource_type=‘OBJECT’查询后会返回一个包含spid和tableName列的表.其中spid是进程名,tableName是表名.2.了解到了究竟是哪个进程锁了哪张表后,需要通过进程找到锁表
2020-09-12 18:58:47
2927
原创 504错误
超时一般是由于程序执行时间过长导致响应超时,例如程序需要执行60秒,而nginx最大响应等待时间为30秒,这样就会出现超时。修改nginx
2020-09-04 11:30:02
1057
原创 wpf core 怎么打包安装包 打包exe安装包
项目场景:wpf core 怎么打包安装包问题描述:这个问题困扰了我很久 用过微软自带的失败用过wix toolset 失败error CNDL0044 : The Class element’s ForeignServer or Server attribute was not found; one of these is required.C:\Program Files (x86)\WiX Toolset v3.11\bin>light.exe -ext WixUIExten
2020-08-28 11:14:15
2587
原创 wpf devexpress 按钮 悬浮解释
<dxe:ButtonInfo x:Name=“select” Content=“查看” ToolTipService.ToolTip=“查看问题” CommandParameter="{Binding}" Click=“select_Click”/>
2020-08-28 10:42:34
617
原创 EF 模糊查询
s => s.XianWID.StartsWith(name)匹配以str开头的s => s.XianWID.EndsWith(name)匹配以str结尾的s => s.XianWID.Contains(name)匹配包含str的
2020-08-24 10:43:44
2088
原创 linq 左连接 linqy 右链接
左连接加where 判断var ls = from imag in _context.ImageAllwhere imag.Proidid&&imag.I_mageLR"L"from csv in _context.Csvdata.Where(csv => csv.ID==imag.I_magebhid).DefaultIfEmpty()where csv.I_ImageType!=tie&& csv.I_ImageType!=bai_heng&&am
2020-08-23 18:52:03
130
原创 两个图片合一块 wpf
public static Bitmap CombinImage(Image imgBack图1, Image img图2, int xDeviation = 0, int yDeviation = 0){Bitmap bmp = new Bitmap(imgBack.Width*2画板宽, imgBack.Height画板高); Graphics g = Graphics.FromImage(bmp); g.Clear(Color.White); g.D
2020-08-13 13:47:55
323
原创 c# 两个list比较,将重复部分去掉
List A = new List();A.Add(“1”); A.Add(“2”); A.Add(“3”);List B= new List();B.Add(“1”); B.Add(“2”); B.Add(“4”);List C = new List();foreach (string item in A){if (!B.Contains(item)){C.Add(item);}}...
2020-08-12 17:03:19
2890
转载 c# wpf winfrom 多张图片合成一张图片
using System;using System.Collections.Generic;using System.Drawing;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Web;namespace ConsoleApp5{class Program{static void Main(string[] args){CombinIma
2020-08-11 20:27:24
959
原创 sql datatime 转 varchar 两个字段组合
CONVERT(varchar(19),iiald.STime)+‘到’+CONVERT(varchar(19),iiald.ETime)数字19 是多少位
2020-08-11 16:05:31
204
原创 自己实现的多左连接 和 group by 使用同服务器多库链接
select iiald.I_W xxx ,iiald.I_LW xxxx, iiald.D_T xxx,iiald.I_N xxx ,iiald.ETime xxxx, count (tif.T_Speeding) xxx from (select ijd.ID, iiai.I_W,iiai.I_LW,iiai.D_T ,iiai.I_N ,ijd.STime,ijd.ETime from (select ii.I_ID,ii.I_W,ii.I_LW, ai.D_T,ii.I_N ,a
2020-08-11 14:44:41
501
转载 SQL的四种连接-左外连接、右外连接、内连接、全连接
内连接inner join…on… / join…on…展现出来的是共同的数据select m.Province,S.Name from member m inner join ShippingArea s on m.Province=s.ShippingAreaID;相当于:select m.Province,S.Name from member m , ShippingArea s where m.Province=s.ShippingAreaID;左连接(左外连接) left join…o
2020-08-11 12:02:39
249
原创 GridColumn 添加按钮后 怎么取到id值 某一行某一列的值
var id = Homegrid.GetFocusedRowCellValue(“编号”);编号是fieladname
2020-08-04 13:15:15
276
原创 GridControl 添加按钮 编辑删除修改
<dxg:GridColumn x:Name="chakan" FieldName="查看" Width="auto" Header="编辑" > <dxg:GridColumn.CellTemplate> <DataTemplate> <dxe:Butto
2020-08-04 10:37:42
889
原创 devpress GridControl 绑定datatable
<dxg:GridControl Name=“Homegrid” HorizontalAlignment=“Left” Margin=“0,31,0,0” VerticalAlignment=“Top” DockPanel.Dock=“Top” Grid.ColumnSpan=“1”><dxg:GridColumn Binding="{Binding 路幅}" FieldName=“fakeFieldName1”/></dxg:GridControl>后台this
2020-08-03 14:24:03
532
转载 Bitmap属性和方法
封装 GDI+ 位图,此位图由图形图像及其特性的像素数据组成。 Bitmap 是用于处理由像素数据定义的图像的对象。继承层次结构System.ObjectSystem.MarshalByRefObjectSystem.Drawing.ImageSystem.Drawing.Bitmap命名空间: System.Drawing程序集: System.Drawing(在 System.Drawing.dll 中)C#语法[SerializableAttribute][ComVisible
2020-08-01 17:35:13
1203
原创 遍历文件夹C#
List ls = new List();string path = @“E:”; DirectoryInfo dir = new DirectoryInfo(path); if (dir.Exists) { DirectoryInfo dirD = dir as DirectoryInfo; FileSystemInfo[] files = dirD.GetFileSystemInfos();
2020-08-01 15:00:57
110
原创 .net读取txt文件
string[] pathtxt = File.ReadAllLines(E:\S234-JZ.txt);string pathtxt = File.Readtext(E:\S234-JZ.txt);
2020-07-31 16:01:40
1853
原创 ComboBoxEdit 选择事件
<dxe:ComboBoxEdit x:Name=“Path” DefaultButtonClick=“Path_DefaultButtonClick” EditValueChanged=“Path_EditValueChanged” HorizontalAlignment=“Left” Margin=“326,72,0,0” VerticalAlignment=“Top” Width=“209” Height=“35” FontSize=“18”/>private void Path_E
2020-07-31 10:41:33
1359
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人