一万光年外  
免费OA软件网 http://www.freeoasoft.com 专注于平台架构设计及OA软件开发

随笔分类 -  小技巧

  • Ado.net处理数据库异常
    摘要:从存储过程中生成错误 T-SQL提供了一个RAISERROR(注意拼写)函数。你可用此函数生成自定义错误,并将错误返回客户。对于ADO.NET客户,SQL Server .NET数据提供程序对这些数据错误进行解释,并把它们转化为SqlError对象。 使用RAISERROR函数最简单的方法是将消息文本作为第一个参数包括进来,然后指定严重及状态参数,如下面的代码片段所示: RAISERROR( 'U... 阅读全文
    posted @ 2007-09-07 10:21 一万光年外 阅读(921) 评论(0) 推荐(0)
  • Byte[]转十六进制
    摘要:// 字节转十六进制private static char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };internal static string ToHexString(byte[] bytes){ char[] chars = new char... 阅读全文
    posted @ 2007-03-14 12:04 一万光年外 阅读(4045) 评论(1) 推荐(0)
  • 格式化数字
    摘要:string.Format("{0:00000000.00}", 20) 结果为:00000020.00string.Format("{0:########.00}", 20) 结果为:20.00 阅读全文
    posted @ 2005-11-14 09:03 一万光年外 阅读(418) 评论(0) 推荐(0)
  • ImageList转为ICON的方法
    摘要:Bitmap bmp=new Bitmap(this.imglst1.Images[0]);Icon icon=Icon.FromHandle(bmp.GetHicon()); 阅读全文
    posted @ 2005-09-22 10:35 一万光年外 阅读(1196) 评论(2) 推荐(0)

 
免费OA软件网 http://www.freeoasoft.com 专注于平台架构设计及OA软件开发