2018年10月10日
摘要: 将文件转化为二进制代码时,出现提示: 文件正由另一进程使用,因此该进程无法访问该文件 原来是构造System.IO.FileStream时,使用的方法有问题 一开始是直接使用 System.IO.FileStream fs = new System.IO.FileStream(fileName, S 阅读全文
posted @ 2018-10-10 08:19 菜鸟也想上天 阅读(5558) 评论(0) 推荐(0)
  2018年9月27日
摘要: 错误: update SupplyInfo set ProdInfo=replace(ProdInfo,'中国总代理','中国指定代理') where CompanyID=83406 正确: update SupplyInfo set ProdInfo=replace(cast(ProdInfo a 阅读全文
posted @ 2018-09-27 10:28 菜鸟也想上天 阅读(341) 评论(0) 推荐(0)
  2018年9月25日
摘要: 使用分析函数row_number() over (partiion by ... order by ...)来进行分组编号,然后取分组标号值为1的记录即可。目前主流的数据库都有支持分析函数,很好用。 其中,partition by 是指定按哪些字段进行分组,这些字段值相同的记录将在一起编号;orde 阅读全文
posted @ 2018-09-25 16:55 菜鸟也想上天 阅读(3268) 评论(0) 推荐(0)
  2018年8月31日
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Data; 6 using System.Data.SqlClient; 7 na 阅读全文
posted @ 2018-08-31 09:00 菜鸟也想上天 阅读(184) 评论(0) 推荐(0)
  2018年8月16日
摘要: 1 public class DBHelper 2 { 3 //数据库连接属性,从config配置文件中获取连接字符串connectionString 4 public static string Connection = ConfigurationManager.AppSettings["ConnectionString"].ToStri... 阅读全文
posted @ 2018-08-16 09:55 菜鸟也想上天 阅读(185) 评论(0) 推荐(0)
摘要: 1 //webconfig配置文件 2 3 4 5 6 7 8 9 10 //DBHelper.cs 11 public static class DBHelper 12 { 13 //数据库连接属性,从config配置文件中获取连接字符串connectionSt... 阅读全文
posted @ 2018-08-16 09:54 菜鸟也想上天 阅读(1928) 评论(0) 推荐(0)
摘要: 1 //ashx文件 2 3 public void ProcessRequest (HttpContext context) { 4 5 string action=context.Request["action"]; 6 7 if (action == "GetIP") 8 { 9 string result; 10 res... 阅读全文
posted @ 2018-08-16 09:41 菜鸟也想上天 阅读(920) 评论(0) 推荐(0)