
C#
文章平均质量分 71
baidu_20993761
这个作者很懒,什么都没留下…
展开
-
Simple example for transform xml with xlst in C#
http://msdn.microsoft.com/zh-cn/library/system.xml.xsl.xslcompiledtransform(v=vs.110).aspx// Load the style sheet.XslCompiledTransform xslt = new XslCompiledTransform();xslt.Load("output转载 2014-09-26 00:16:21 · 413 阅读 · 0 评论 -
Creation of the private accessor ... failed in Visual Studio 2010
I got above error when i try to create unit test for private method IsConnectionOK.I remembered I manually removed the Test Reference folder in test project by deleting below xml node from .csproj f原创 2014-12-18 14:03:29 · 513 阅读 · 0 评论 -
MSbuild failure: error CS0246: The type or namespace name 'DataLoader_Accessor' could not be found
Error:The type or namespace name ‘MyClass_Accessor’ could not be found (are you missing a using directive or an assembly reference?Resolution:Step 1: Deploy publicize component to the转载 2014-12-18 14:58:54 · 3441 阅读 · 0 评论 -
使用DataContractJsonSerializer进行序列化和反序列化
只是简单的例子,使用时要进行封装以方便重用。原创 2015-07-02 13:53:17 · 1952 阅读 · 0 评论 -
log4net 使用方法
1、下载http://mirror.bit.edu.cn/apache//logging/log4net/binaries/log4net-1.2.13-bin-newkey.zip, 解压,复制log4net.dll到项目目录,添加引用;2、在项目中添加应用程序配置文件 app.config:原创 2015-06-14 17:46:14 · 556 阅读 · 0 评论 -
DataTable.AcceptChanges方法有何用处
提交自上次调用 AcceptChanges 以来对该表进行的所有更改。调用 AcceptChanges 后,再用 DataAdapter.Update() 不会有任何新数据被更新到数据库中。那……那它有什么用处呢?Fill –> Edit –> Update –> AcceptChanges –> Edit –> Update –> AcceptChanges –> Edit –>转载 2015-06-15 22:18:49 · 495 阅读 · 0 评论 -
C# Linq: Join两个DataTable
方案一:当能够确定DtAll表的字段,并且字段不是很多的情况下,可以显式写出:var query1 = from rHead in dtHead.AsEnumerable() from rTail in dtTail.AsEnumerable() where rHead.Field('GoodID') == rTail.Field('GoodID') s转载 2015-06-15 22:37:18 · 6047 阅读 · 0 评论 -
log4net - Write log to WinForm TextBox
转载,测试可用,http://www.cnblogs.com/mrfangzheng/archive/2012/11/29/2795133.html。using System;using System.Collections.Generic;using System.Linq;using System.Text;using log4net.Appender;using System.转载 2015-06-14 17:42:27 · 1271 阅读 · 0 评论 -
C# 协变逆变(泛型修饰符in和out)
in和out用在范型interface和delegate中, 用来支持逆变和协变(in是逆变,out是协变)。协变保留赋值兼容性,逆变与之相反。下例中,泛型接口类型参数T有out修饰符,所以 a) 支持协变,ITest b = new D(); 可以编译通过,而ITest d = new B();出错;b) T类型只能用过函数返回值,故 T GetInstance(); 编译通原创 2015-08-04 10:02:27 · 9556 阅读 · 0 评论