随笔分类 -  .net

sql datareader多线程访问时出错
摘要:Exception: System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) 使用Idatareader返回数据时,如果多个线程同时调用一个方法,可能返回的reader数据已经被修改,因此需要改为返回DataTable or dataRow. 而且如果多个地方调用同一个静态方法来返回数据对象,则在此方法中的DBC... 阅读全文

posted @ 2008-04-07 00:01 margiex 阅读(683) 评论(0) 推荐(0)

使用.net创建activex控件
摘要:1. . 创建.net activeX 示例: http://www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp 首先要在类定义前面添加: [ProgId("MyClassName")] COM调用名称 [Guid("MyGUID")] sdf COM对应的GUID [ComVisible(true)] 是否为COM组件 a... 阅读全文

posted @ 2008-03-10 18:22 margiex 阅读(3180) 评论(0) 推荐(1)

dotfuscator notes
摘要:1. 使用了web service的部分不应该rename, 包括WS proxy class and properties/settings.cs部分. 2. 使用了反射的部分也不能rename,否则找不到对应的类/方法. 3. 自定义的enum类型最好不要混淆,如果是某些地方要引用ENUM的类型名称输出为string,则显示混淆后的名称了. 阅读全文

posted @ 2008-03-09 18:53 margiex 阅读(278) 评论(0) 推荐(0)

google scan 源代码下载
摘要:source code 主窗口中利用dataset保留的几张表定义: DataSet: History Table: setting: name, value history: ID, name, CountAnswer list: ID, IDkeyword, name file: ID, IDsite, Name 阅读全文

posted @ 2008-02-25 09:58 margiex 阅读(468) 评论(0) 推荐(0)

treegrid能运行版本
摘要:本地下载:/Files/margiex/TreeGrid2.rar 我只是改来能运行,版本还是归下面连接的朋友所有. 所有下级结占必须与根结点的字段相同,感觉用处不是太大.或许可以扩展一下. 源地址: http://e65.sogot.com/Pages/treegrid.aspx 阅读全文

posted @ 2008-02-01 16:44 margiex 阅读(606) 评论(0) 推荐(0)

asp.net notes
摘要:cache's expire problem string sendTimeKey = "abc_sendtime"; //DateTime dtLast = (DateTime)cache[sendTimeKey]; if (Cache[sendTimeKey] == null) { ... 阅读全文

posted @ 2008-01-19 21:43 margiex 阅读(302) 评论(0) 推荐(0)

visual studio notes
摘要:1. .net framework source已经可以在vs2008中使用 ref: http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx http://blogs.msdn.com/sburke/archive/2008/01/16/con... 阅读全文

posted @ 2008-01-17 09:36 margiex 阅读(530) 评论(0) 推荐(0)

treeview check cascading
摘要:网上找的,记在这里,以免忘记. //获取元素指定tagName的父元素 function public_GetParentByTagName(element, tagName) { var parent = element.parentNode; var upperTagName = tagName.toUpperCase(); //如果这个元素还不是想要的tag就继续... 阅读全文

posted @ 2008-01-09 23:35 margiex 阅读(506) 评论(0) 推荐(0)

在asp.net下上传大文件的方法及控件(引用)
摘要:web.config中的设置及IIS设置 http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx 一个上传文件控件 http://www.brettle.com/neatupload 极其强悍的带progressbar的上传控件, http://demo.swfupload.org... 阅读全文

posted @ 2008-01-08 23:14 margiex 阅读(563) 评论(0) 推荐(0)

C#中判断一个类是否实现了某interface
摘要:1using System; 2using System.Threading; 3using System.Text; 4using System.Net; 5using System.Net.Sockets; 6using System.IO; 7using System.Data; 8using System.Collections; 9using System.Collec... 阅读全文

posted @ 2008-01-03 21:55 margiex 阅读(530) 评论(0) 推荐(0)

所有各数据库或文件的连接串定义CHM文件.
摘要:从www.connectionstrings.com 中制作生成 /Files/margiex/DotnetConn.rar 阅读全文

posted @ 2007-12-18 11:09 margiex 阅读(317) 评论(1) 推荐(0)

dotnet framework 3.5 installed issues on non-english os
摘要:当离线安装此文件时,会要求下载,如果没有下载成功,最后完成时可能会报一个错误. 其实上面的下载是要求下载语言包,如果没有对应OS的语言包,则可以在安装时先解压 dotnetfx35.exe /x to uncompress dotnetfx35.exe and run,然后 dotnetfx35setup.exe /lang:ENU,跳过下载,只安装英文语言包。 或者先下载对应OS的语言包,然后拷... 阅读全文

posted @ 2007-12-10 10:13 margiex 阅读(1408) 评论(0) 推荐(0)

wikipedia的mysql utf-8中文在.net中的处理
摘要:使用Mysql.Net connector,而不是odbc或oledb进行数据库连接。即使用MySqlConnection, MySqlCommand等类。 然后每次连接数据库之后,先执行SQL: set names 'utf8' 针对 varbinary类型的字段: 输入, MySqlParameter param = new MySqlParameter("titl... 阅读全文

posted @ 2007-12-08 16:42 margiex 阅读(694) 评论(0) 推荐(0)

web service notes
摘要:性能提高 压缩传输数据, 减少多次调用, XML解析器的优化和选择, 简化标签, 缓存机制 ref: http://www.ibm.com/developerworks/cn/webservices/0710_wangyun/index.html?S_TACT=105AGX52&S_CMP=NL&ca=dnl-cn-11212007 in class librar... 阅读全文

posted @ 2007-11-22 08:32 margiex 阅读(280) 评论(0) 推荐(0)

C# & vs note
摘要:C#中正则表达表判断是否为汉字: [\u4e00-\u9fa5] http://topic.csdn.net/t/20040911/09/3362107.html Cannot execute a program. The command being executed was "C:\Windows\Microsoft.NET\Framework\v2... 阅读全文

posted @ 2007-11-06 17:37 margiex 阅读(991) 评论(0) 推荐(0)

在C#中向windows窗体发送消息示例
摘要:// define [DllImport("User32.dll")] public static extern IntPtr FindWindow(String lpClassName, String lpWindowName); [DllImport("User32.dll")] static extern IntPtr FindWindowEx... 阅读全文

posted @ 2007-10-26 15:14 margiex 阅读(2438) 评论(0) 推荐(0)

设置vs2005中编译输出的明细
摘要:设置vs2005中编辑显示的明细情况,有利于确定编译过程中的错误. http://geekswithblogs.net/michelotti/archive/2006/07/31/86754.aspx 阅读全文

posted @ 2007-10-10 13:54 margiex 阅读(542) 评论(0) 推荐(0)

一个比较好用的vs2005插件
摘要:可以直接打开工程文件夹,进入命令行,文件比较等. http://www.codeproject.com/csharp/WebReports8.asp 阅读全文

posted @ 2007-09-28 22:59 margiex 阅读(294) 评论(0) 推荐(0)

btnet中添加email通知
摘要:btnet是一个.net开源的BUG跟踪系统,此处可下载 http://sourceforge.net/projects/btnet/ 当有BUG产生或修复某个bug之后, 为了方便通知项目组内其它成员,最好能有邮件通知. 首先,登录此系统的各用户在个人资料中需要输入一个自己的信箱. 并订阅相关的bug项目, 当然可以设置订阅新增还是update bug时的信息, 也可设置订阅自己提交的bug ... 阅读全文

posted @ 2007-09-25 21:44 margiex 阅读(361) 评论(0) 推荐(0)

asp.net notes
摘要:Password TextBox and PostBack // Refill Password field this.txtPassword.Attributes.Add("value", this.txtPassword.Text); ajax cascadingdown, 只能在放有cascadingdown控件的页面上设置static web method... 阅读全文

posted @ 2007-09-04 22:46 margiex 阅读(384) 评论(0) 推荐(0)