
C#
成成
进入IT业开始做维护的,现在却搞起了编程
展开
-
超过8点当做早班,超过20点当做晚班
SQL查询按时间出结果原创 2022-09-01 14:29:03 · 1889 阅读 · 0 评论 -
sql 转换科学计数法为浮点显示
convert(NVARCHAR(50),CONVERT(DECIMAL(28,0),CONVERT(FLOAT,PQTY)))原创 2022-01-19 15:18:09 · 2827 阅读 · 0 评论 -
查询2021-12全月日期
select convert(varchar(10),dateadd(dd,number,'2021-12-01'),120) as dtfrom master..spt_valueswhere type='P'and dateadd(dd,number,'2021-12-01')<=dateadd(dd,-1,convert(varchar(8),dateadd(mm,1,'2021-12-01'),120)+'01')原创 2022-01-16 09:44:05 · 334 阅读 · 0 评论 -
SQL判断时间是否小于8点15分,如果是,日期算昨天
select top 20000 printtime,case when convert(time,printtime)<'08:15:00' then convert(varchar(10),dateadd(day,-1,printtime),120) else convert(varchar(10),printtime,120) end from barcode order by id desc原创 2021-11-10 16:19:07 · 1302 阅读 · 0 评论 -
试图加载 Crystal Reports 运行时出现错误
使用any cpu进行编译32位系统升级64位系统后程序原来的水晶报表不能使用错误信息:试图加载 Crystal Reports 运行时出现错误。或者 Crystal Reports 注册密钥所拥有的许可不足,或者 Crystal Reports 运行时组件未被正确安装。请安装适当的 Crystal Reports 再分发文件(CRRedist*.msi)包含所需的 Crystal Reports 运行时组件的正确版本(x86、x64或 Itanium)。若需更多信息请访问http://www.原创 2021-07-24 15:13:51 · 6458 阅读 · 3 评论 -
开始结束日期之间的全部日期列表
select format(dateadd(dd,number,'2021-05-01'),'MM月dd日') AS datefrom master..spt_valueswhere type='p' and dateadd(dd,number,'2021-05-01')<='2021-05-10'原创 2021-07-20 11:38:59 · 127 阅读 · 0 评论 -
SQL分页读取
select '' 序号,fujianserial 附件序号,FUJIANHAOMA 附件号, getname 种类,TicketNoStart 开始票号,TicketNoEnd 结束票号,getnum 数量,inputuser 发出者,outtime 发出时间,GETUSER 领取部门,getdepartment 领取者,beizhu 备注,AttachFileName,AttachFileName1,AttachFileName2,AttachFileName3,AttachFileURL,Attac.原创 2021-01-20 18:26:19 · 197 阅读 · 0 评论 -
加一列 default 当前时间
alter table localbox add itime datetime default(convert(varchar(20),getdate(),120)) null原创 2020-09-09 11:08:29 · 288 阅读 · 0 评论 -
已有数据表增加自增列
alter table diaobotable add id int identity(1,1) not null原创 2020-06-30 13:16:58 · 933 阅读 · 0 评论 -
未能加载文件或程序集“Seagull.BarTender.Print, Version=10.1.4.1, Culture=neutral, PublicKeyToken=109ff779a1b4cb
解决办法:把工程目标生成平台改为x86 不要用anycpu 问题解决原创 2020-06-10 09:36:43 · 3977 阅读 · 0 评论 -
C# 四舍五入方法
忘了从哪里抄来的 /// <summary> /// 实现数据的四舍五入法 /// </summary> /// <param name="v">要进行处理的数据</param> /// <param name="x">保留的小数位数</param> /// <returns>四舍五入后的结果</returns>原创 2020-06-09 09:33:52 · 570 阅读 · 0 评论 -
flexcel apimate用途
点击openfile选择你要导入的文件马上就可以生成该文件格式的所有代码,原创 2020-06-07 15:59:38 · 213 阅读 · 0 评论 -
flexcel复制sheet用法
//添加新sheet,复制sheet1的14行内容到新sheet的第2行, for (int q = 2; q < 10; q++){ xls.AddSheet(); for (k = 1; k < 19; k++) { xls.CopyCell(xls, 1, q, 14, k, 2, k, TRangeCopyMode.All); }}//新建sheet并复制sheet1内容for (int q = 1; q ...原创 2020-06-07 15:57:42 · 575 阅读 · 0 评论 -
查找每个线号最新记录
select a.linename,b.kedonglv,b.itime,b.zhixinglv from (select linename,max(id) ids from CHUHE_KEDONGLVRECORD group by linename) a inner join CHUHE_KEDONGLVRECORD b on a.ids=b.id原创 2020-05-15 11:01:25 · 172 阅读 · 0 评论 -
剔除吃饭时间休息时间,生产线上的传动率计算用
select sum(shijian) from (select datediff(second,'2020-04-16 10:10:01','2020-04-16 08:40:01') biaozhi,datediff(second,'2020-04-16 08:40:01',getdate()) times,600 shijianunion allselect datediff(seco...原创 2020-04-17 09:44:07 · 217 阅读 · 0 评论 -
删除重复数据,留一条
--删除重复sl_inboxdelete afrom sl_inbox awhere exists(select 1 from MMV_DB_SLCHONGFU b where b.box=a.box and b.ofspstate=a.ofspstate and b.id>a.id)...原创 2019-10-16 17:15:53 · 214 阅读 · 0 评论 -
自己比较少用正则,这里记录一个
string s="^[0-9]*$";//正则表达式Regex reg=new Regex(s);if(!reg.IsMatch(this.textbox1.text)){ MessageBox.Show("请输入数字");}原创 2012-11-24 17:23:59 · 261 阅读 · 0 评论 -
验证textbox中是否为数字回退键和小数点键
/// /// 检查只能输入小数点,数字和退格 /// /// /// private void Numeric_Check(object sender, KeyPressEventArgs e) { TextBox tb = (TextBox)sender转载 2014-04-28 11:20:16 · 590 阅读 · 0 评论 -
取PDA序列号(机器号)
private static Int32 METHOD_BUFFERED = 0; private static Int32 FILE_ANY_ACCESS = 0; private static Int32 FILE_DEVICE_HAL = 0x00000101; private const Int32 ERROR_NOT_SUPPORTED转载 2014-05-19 08:29:42 · 2487 阅读 · 0 评论 -
C#分离文件和路径的方法
string strPath = textBox1.Text.Substring(0, textBox1.Text.LastIndexOf("\\"));string strName=textBox1.Text.Substring(textBox1.Text.LastIndexOf("\\")+1,(textBox1.Text.LastIndexOf(".")-textBox1.Text.La转载 2013-08-20 21:23:03 · 3594 阅读 · 0 评论 -
C# webservice调用app_data文件夹中的文件
DBPath = Server.MapPath("/BAOSERVICE/App_Data/baobo.xml"); 其中"BAOSERVICE” 需以浏览器访问地址为准,即便你的文件路径是 C:\SERVICE\App_Data\baobo.xml 编写代码时仍然需要改写为IIS中的应用程序名 BAOSERVICE转载 2013-06-03 10:38:32 · 3241 阅读 · 0 评论 -
rapi操作函数复制文件到PDA出现Could not create remote file
问题终于解决,原来一开始没做rapi是否已经连接PDA的判定,导致一直出现合格错误 private bool mcConnected = false; private void timer1_Tick(object sender, EventArgs e) { if (this.connectMC())原创 2013-04-19 00:25:03 · 2164 阅读 · 0 评论 -
wince任务栏的隐藏和显示
[DllImport("coredll.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, int pvParam, uint fWinIni); [D转载 2013-04-11 12:17:05 · 740 阅读 · 0 评论 -
QRCODE的QrcodeVersion问题
为什么要在生成二维码的时候,判断字符集的长度要小于128。要知道二维码信息容量大:可容纳多达1850个大写字母或2710个数字或1108个字节,或500多个汉字,比普通条码信息容量约高几十倍。如果控制压缩内容在128个以内的话,那么二维码的优势哪里去了?经过多次测试发现,二维码所能包含的字符信息量是由QrcodeVersion的设置值来决定的。将QrcodeVersion设置到20的时转载 2013-04-11 12:15:36 · 14323 阅读 · 1 评论 -
vs调试DLL方法
1.在调用DLL的项目中添加dll的项目2.引用必须指向dll源代码的bin中的文件3.dll中设置断点4.设置启动程序为exe的项目转载 2013-04-05 00:50:59 · 750 阅读 · 0 评论 -
K3凭证内码 FVchInterID
select * from t_Voucher where fvoucherid in (select FVchInterID from ICStockBill where fbillno like 'WOUT%' group by FVchInterID)原创 2014-11-24 11:09:12 · 6502 阅读 · 0 评论 -
C# 访问win7 64bit 无安装access的mdb文件出现未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”
原开发程序是x86的,到http://www.microsoft.com/zh-cn/download/details.aspx?id=13255下载 Microsoft Access 2010 数据库引擎可再发行程序包x86的,然后程序修改将Microsoft.Jet.OLEDB.4.0更改成Microsoft.ACE.OLEDB.12.0原创 2015-09-19 14:26:06 · 1551 阅读 · 0 评论 -
c# 顾显清屏的类
//顾显清屏的类using System;using System.Collections.Generic;using System.Text;namespace rent_li{ class Ledclear { public void ledcls() { try { do原创 2009-10-13 12:47:00 · 1349 阅读 · 0 评论 -
sql 修改数据类型语句
ALTER TABLE MST_XCINVENTORYLIST ALTER COLUMN MAKETIME datetime转载 2018-12-30 19:57:22 · 9168 阅读 · 1 评论 -
64位windows7 C#.net引用VC++ com组件错误80040154的解决方法
64位windows7 C#.net引用VC++ com组件错误80040154的解决方法在32位windows7下,使用VS2008(VC++)开发了个32位的com组件,在VS2008(C#.net winform)程序中引用这个组件,在32位windows7可正常运行,在64位windows7无法正常运行。64位windows7用VS2008重新编译后,提示“检索 COM 类工厂中 CL...转载 2018-08-17 15:10:17 · 1807 阅读 · 0 评论 -
alter 或者索引有关
创建索引create unique index ix_uni_Barcode_QRbarcode on Barcode(QRbarcode)改列名exec sp_rename 'barcode.ccode','pccode','COLUMN';删除列名alter table barcode drop column cdefine10转载 2017-09-08 14:01:44 · 213 阅读 · 0 评论 -
在Windows7 64位和VS2008环境下,PrintDialog.ShowDialog不能显示打印对话框
在VS2008中编写如下代码:PrintDialog printDialog = new PrintDialog();printDialog.ShowDialog();在XP环境下,它可以正常显示出打印对话框。但在Windows 7 64位环境下,什么也显示不出来,也没有异常抛出。将PrintDialog.UseEXDialog属性设置为True,可显示出打印对话框。转载 2017-05-21 13:31:02 · 1239 阅读 · 0 评论 -
WINDOWS2003下的打印问题
If PrintDialog1.ShowDialog() = DialogResult.OK Then运行这句的时候自动跳过,奇怪,暂时没办法解决原创 2016-04-14 23:34:35 · 351 阅读 · 0 评论 -
C# textbox快捷键添加横杠
private void textBoxCinvcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F12) { string temp = this.textBoxCinvcode.Text.Trim();转载 2016-04-02 18:28:41 · 1225 阅读 · 0 评论 -
C#更改wince的时间
using System.Runtime.InteropServices; [DllImport("coredll.Dll", SetLastError = true)] //kernel32.dllpublic static extern int SetLocalTime(ref SystemTime lpSystemTime); private void转载 2013-06-03 10:28:11 · 1457 阅读 · 0 评论 -
欢迎使用优快云-markdown编辑器
win7下无安装access需要调用但出现未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0” 问题原创 2015-09-19 12:49:17 · 377 阅读 · 0 评论 -
datagridview 编辑后最后一项改动识别不了
今天在需要使用EndEdit() 方法,结束编辑后,否则最后一项改动识别不了原创 2012-10-23 15:09:31 · 577 阅读 · 0 评论 -
显示一个提示窗口,等进程操作完成自动消失
m_busyForm mbusy_chuli = new m_busyForm(); mbusy_chuli.Show(); mbusy_chuli.Refresh(); //中间处理环节 mbusy_chuli.Close(); 如果显示的是动画,还需要增加DoEven来释放转载 2012-06-11 16:15:24 · 531 阅读 · 0 评论 -
oledb的类库Common和DataAccess
Common的Class1.cs using System;using System.Collections.Generic;using System.Text;namespace Common{ public class Class1 { public const string ConnectString = "Provider=Microsoft.Jet原创 2009-11-04 09:56:00 · 1021 阅读 · 0 评论 -
form间传值,bool型
form1 :button1form2:bt_ok,bt_cancle public Form1() { InitializeComponent(); }private void button1_Click(object sender, EventArgs e) { Form2 form2 =原创 2009-10-22 14:35:00 · 1067 阅读 · 0 评论