上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页
摘要: C#中IndexOf的使用 IndexOf() 查找字串中指定字符或字串首次出现的位置,返首索引值,如: str1.IndexOf("字"); //查找“字”在str1中的索引值(位置) str1.IndexOf("字串");//查找“字串”的第一个字符在str1中的索引值(位置) str1.Ind 阅读全文
posted @ 2019-12-31 18:19 net-sky 阅读(35834) 评论(0) 推荐(0) 编辑
摘要: 方法1 Substring(Int32) 从此实例检索子字符串。 子字符串在指定的字符位置开始并一直到该字符串的末尾。 方法2 Substring(Int32, Int32) 从此实例检索子字符串。 子字符串从指定的字符位置开始且具有指定的长度。 参数一:起始位置(从0开始) 参数二:指定长度 用法 阅读全文
posted @ 2019-12-31 18:18 net-sky 阅读(40873) 评论(2) 推荐(0) 编辑
摘要: 我们知道in可以实现一个范围内的查询,like可以实现模糊查询, 如 select *where col like 123%但是我们如果有一列attri,如123,132,165... 我们想实现123%和132%的模糊查询该怎么办呢? 那么就要变通一下方法,实现in和like同时使用的效果。 se 阅读全文
posted @ 2019-12-10 18:05 net-sky 阅读(9988) 评论(0) 推荐(0) 编辑
摘要: Math.Round:四舍六入五取整 Math.Ceiling:向上取整,只要有小数都加1 Math.Floor:向下取整,总是舍去小数 出处:https://www.cnblogs.com/dansediao/p/5662481.html 阅读全文
posted @ 2019-12-10 13:18 net-sky 阅读(10710) 评论(1) 推荐(0) 编辑
摘要: Select(); Select("id>='3' and name='3--hello'");//支持and Select("id>='3' or id='1'");//支持or Select("name like '%hello%'");//支持like Select("id>5","id de 阅读全文
posted @ 2019-12-09 18:07 net-sky 阅读(3191) 评论(0) 推荐(0) 编辑
摘要: 这篇主要介绍2、4。第三种方法使用的比较局限,所以我没有深入学习。 第二种方法 我使用比较多的方式,这个方法是.NET内置的,使用起来比较方便 A、利用serializer获取json的泛型对象 利用Dictionary<string,object>接收转换完的json对象,然后用查询泛型的指令即可 阅读全文
posted @ 2019-12-05 16:33 net-sky 阅读(4558) 评论(0) 推荐(0) 编辑
摘要: 在很多对象显示为字符串的时候都会使用到ToString中的格式化,由于以前没怎么注意到这个问题,想总结一下各个基础结构对象的格式化,以便后备之用!!! Int.ToString(format): 格式字符串采用以下形式:Axx,其中 A 为格式说明符,指定格式化类型,xx 为精度说明符,控制格式化输 阅读全文
posted @ 2019-12-02 17:15 net-sky 阅读(2056) 评论(0) 推荐(0) 编辑
摘要: 今天的所有数据:select * from 表名 where DateDiff(dd,datetime类型字段,getdate())=0昨天的所有数据:select * from 表名 where DateDiff(dd,datetime类型字段,getdate())=17天内的所有数据:selec 阅读全文
posted @ 2019-11-29 17:53 net-sky 阅读(8260) 评论(0) 推荐(0) 编辑
摘要: //C#计算两个时间年份月份差 DateTime dt1 = Convert.ToDateTime("2008-8-8"); DateTime dt2 = System.DateTime.Now; int Year = dt2.Year - dt1.Year; int Month = (dt2.Ye 阅读全文
posted @ 2019-11-19 09:44 net-sky 阅读(4289) 评论(0) 推荐(0) 编辑
摘要: 第一种方法: 第二种方法: 第三种方法:直接返回json文件,设置返回类型ContentType为“application/json": 阅读全文
posted @ 2019-11-08 17:12 net-sky 阅读(797) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页