This topic describes how to find, install, remove, and update NuGet packages using PowerShell commands. You can also work with packages using theManage NuGet Packagesdialog box. For more information, see [Using the Manage NuGet Packages dialog](Using-the Add-Library-Package-Reference-Dialog-Box).Usi Read More
select * from users order by id limit 10 offset 0;//offset代表从第几条记录“之后“开始查询,limit表明查询多少条结果运用:sqlitecmd.CommandText = string.Format("select * from GuestInfo order by GuestId limit {0} offset {0}*{1}", size, index-1);//size:每页显示条数,index页码 Read More
新建一个appconfig文件,添加如下代码<?xml version="1.0" encoding="utf-8" ?><configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup></configuration> 问题OK了参考:http://hi.baidu.com/wfoss Read More
右键解决方案,点击属性或者在,生成也能找到配置管理器最后修改右键项目属性,在生成找到目标平台,改成和警告的那个一样就行 Read More
反射用好了真的强大,下面就简单示例一下利用反射写各错误日志的插件。原理:先生成一个dll文件,这个文件是用来将错误消息写入到文件,或者是将消息保存到数据库中,反正这个dll(插件)就是用来处理错误消息的,错误消息从哪里来呢?当然是主程序了,这都用问,o(︶︿︶)o ,我又一次被BS了,:-),那么我们怎么用这个外部的dll文件呢,当然是用反射了,我们把这个dll文件的路径、dll里的类名、方法名这些放在一个配置文件里,然后通过反射取到他们,再调用他,说白了就是动态加载。这描述能力.... 自己先寒一个 — —!代码:先写个写入txt文件的类,然后生成dll文件,代码很简单,没什么好说的,当然. Read More
/// <summary> /// sql到C#的数据类型转换 /// </summary> /// <param name="typename">sql数据类型名称</param> /// <returns>C#名称</returns> public static string SqlToCsharp(string typename) { switch (typename) { case "bit": return "Boolean"; ... Read More
.net framework 中DateTime.MinValue => 0001/01/01 00:00:00DateTime.MaxValue => 9999/12/31 23:59:59.999SqlDateTime.MinValue.Value => 1753/01/01 00:00:00SqlDateTime.MaxValue.Value => 9999/12/31 23:59:59.997 (注意毫秒是997) sql server中:DateTime 最小值 => 1753/01/01 00:00:00SmallDateTime 最小值 => Read More
foreach (Control item in this.panel1.Controls){ if (string.IsNullOrEmpty(((TextBox)item).Text)) { this.label1.Text += ((TextBox)item).Name + "为空"; } }用扩展方法验证空字符串:namespace System{ public static class CheckStringEmpty { public static bool IsNullOrEmpty... Read More
--获取最小: --方法1:CREATE FUNCTION [dbo].[MinimumDateValue]()RETURNS DATETIMEASBEGIN RETURN CONVERT(DATETIME, '1753-01-01', 121)END --方法2: declare @Date smalldatetimeset @Date=0select @Date --获取最大 CREATE FUNCTION [dbo].[MaximumDateValue]()RETURNS DATETIMEASBEGIN RETURN CONVERT(DATETIME, '9999 Read More
CREATE FUNCTION dbo.fnSplit( @sInputList VARCHAR(8000), -- List of delimited items列表分隔的项目 @sDelimiter VARCHAR(8000) = ',' -- delimiter that separates items分隔符分隔的项目)RETURNS @List TABLE (item VARCHAR(8000))BEGINDECLARE @sItem VARCHAR(8000) WHILE CHARINDEX(@sDelimiter,@sInputList,0) <> 0 Read More