修复数据库错误

2024年4月21日 开发日志 评论已被关闭

declare @sql varchar(100)
while 1=1
begin
select top 1 @sql = ‘kill ‘+cast(spid as varchar(3))
from master..sysprocesses
where spid > 50 and spid <> @@spid
if @@rowcount = 0
break
exec(@sql)
end

ALTER DATABASE XZ_KCMM SET SINGLE_USER
DBCC CheckDB (XZ_KCMM , REPAIR_ALLOW_DATA_LOSS)
DBCC CheckDB (XZ_KCMM , REPAIR_REBUILD)
DBCC CheckDB (XZ_KCMM , REPAIR_FAST)
ALTER DATABASE XZ_KCMM SET MULTI_USER

自定义表格下拉筛选项

2024年2月8日 开发日志 评论已被关闭

using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Infragistics.Win;
using Infragistics.Win.AppStyling;
using Infragistics.Win.AppStyling.Runtime;
using Infragistics.Win.UltraWinGrid;
using System.Drawing.Imaging;
namespace Filter
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

this.grid.InitializeLayout += new InitializeLayoutEventHandler(grid_InitializeLayout);
this.grid.BeforeRowFilterDropDownPopulate += new BeforeRowFilterDropDownPopulateEventHandler(grid_BeforeRowFilterDropDownPopulate);
this.grid.DataSource = this.Table;

}

void grid_BeforeRowFilterDropDownPopulate(object sender, BeforeRowFilterDropDownPopulateEventArgs e)
{
e.Handled = true;
e.ValueList.ValueListItems.Clear();
e.ValueList.ValueListItems.Add( “(All)” );
e.ValueList.ValueListItems.Add( new RangeConditionInt32(e.Column, 2, 4) );
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}

void grid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
e.Layout.Bands[0].Columns[1].AllowRowFiltering = DefaultableBoolean.True;
}

private DataTable Table
{
get
{
DataTable table = new DataTable();
table.Columns.Add(“col1”, typeof(string));
table.Columns.Add(“col2”, typeof(int));
for (int i = 0; i < 100000; i++)
{
table.Rows.Add( new object[]{“a”, 1} );
table.Rows.Add( new object[]{“b”, 2} );
table.Rows.Add( new object[]{“c”, 3} );
table.Rows.Add( new object[]{“d”, 4} );
table.Rows.Add( new object[]{“e”, 5} );
table.Rows.Add( new object[]{“f”, 6} );
table.Rows.Add( new object[]{“g”, 7} );
table.Rows.Add( new object[]{“h”, 8} );
table.Rows.Add( new object[]{“i”, 9} );
table.Rows.Add( new object[]{“j”, 10} );
}

return table;
}
}
}

public class RangeConditionInt32 : FilterCondition
{
public RangeConditionInt32( UltraGridColumn column, int min, int max )
{
this.Column = column;
this.Min = min;
this.Max = max;
}

public new UltraGridColumn Column { get; private set; }
public int Min { get; private set; }
public int Max { get; private set; }

public override bool MeetsCriteria(UltraGridRow row)
{
object cellValue = row.Cells[this.Column].Value;
if ( (cellValue is int) == false )
return false;

int val = (int)(row.Cells[this.Column].Value);
return val >= this.Min && val <= this.Max;
}

public override string ToString()
{
return string.Format(“x >= {0} && x <= {1}”, this.Min, this.Max);
}
}

}

sql死锁

2023年11月4日 开发日志 评论已被关闭

select
request_session_id spid,
OBJECT_NAME(resource_associated_entity_id) tableName
from
sys.dm_tran_locks
where
resource_type=’OBJECT’

 

 

kill spid

解决 SqlServer 排序规则问题 SQL_Latin1_General_CP1_CI_AS“ and “Chinese_PRC_CI_AS“,无需重装数据库,命令行修改

2023年2月19日 开发笔记 评论已被关闭

获取动态sql的返回值exec

2023年1月25日 开发日志 评论已被关闭

数据库检查

2022年11月5日 开发日志 评论已被关闭

OwinStartup 不触发

2022年10月6日 开发日志 评论已被关闭

关于WebAPI跨域踩到的一点坑

2022年10月6日 开发日志 评论已被关闭

汉印打印机

2022年8月30日 开发日志 评论已被关闭

iis-dumps

2022年8月22日 开发日志 评论已被关闭