随笔分类 -  ASP.NET

Unable to convert MySQL date/time value to System.DateTime 错误
摘要:C#读取MySql时,如果存在字段类型为date/datetime时的可能会出现以下问题“Unable to convert MySQL date/time value to System.DateTime”原因:可能是该字段(date/datetime)的值默认缺省值为:0000-00-00/0000-00-00 00:00:00,这样的数据读出来转换成System.DateTime时就会有问题;解决办法:1、将该字段的缺省值设置为null,而不是0000-00-00/0000-00-00 00:00:00的情况;2、在链接MySQL的字符串中添加:Convert Zero Datetime 阅读全文
posted @ 2012-08-30 15:47 Aeron 阅读(17693) 评论(0) 推荐(5)
winform中的webbrowser里面操作html代码问题
摘要:最近做了个webBrowser模拟浏览器去抓取某些网站的内容,在对抓回来的饿内容做解析时,htmlelement里面只能获得元素的特殊属性如id,name等,但是获取不到class,后来查了下,需要引入一个Microsoft.mshtml.dll,然后var ele = (mshtml.IHTMLElement)domEle.DomElement; var className = ele.className;即可而这样:domEle.GetAttribute("class"); 获得的始终为空。 阅读全文
posted @ 2012-06-15 15:50 Aeron 阅读(353) 评论(0) 推荐(0)