<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_♨  NewSea#'s Sky_分类_C# 开发技术与实战</title><id>http://feed.cnblogs.com/blog/u/21750/category/71822/rss</id><updated>2012-06-04T23:38:15Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/category/71822.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/21750/category/71822/rss"/><entry><id>http://www.cnblogs.com/newsea/archive/2012/04/19/2456440.html</id><title type="text">NameValueCollection To Json 。</title><summary type="text">原文：http://stackoverflow.com/questions/7003740/how-convert-namevaluecollection-to-json-stringNameValueCollection 转换为 Json 的时候，只把它的Keys 数组 转换为Json ，忽略了 Value ， 方法就是把 NameValueCollection 转换为 字典，再转为Json自定义Json转换类： public static class JsonHelper { public static string ToJson&lt;T&gt;(this T source...</summary><published>2012-04-18T17:52:00Z</published><updated>2012-04-18T17:52:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/04/19/2456440.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/04/19/2456440.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/04/17/2454038.html</id><title type="text">试用 CouchBase。</title><summary type="text">Memcached 问世以来，风声水起，也不断更新着，当初只是做分布式缓存， 到 MemBase ，已经是可以分布式缓存+存储机制的产品了。 最后听说与 CouchDb 合并成了： CacheBase 。试用了一下，效果不错。CacheBase网址：下载服务器端和客户端：http://www.couchbase.com/download教程：http://www.couchbase.com/docs/couchbase-sdk-net-1.0/getting-started.html按照例子做了一个。服务器界面很舒服。例子的配置文件 需要把 servers 的 bucket (桶？) 和 bu</summary><published>2012-04-17T09:32:00Z</published><updated>2012-04-17T09:32:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/04/17/2454038.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/04/17/2454038.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/04/12/2444405.html</id><title type="text">GetHashCode 笔记 。</title><summary type="text">MSDN：http://msdn.microsoft.com/zh-cn/library/system.object.gethashcode(v=vs.80).aspx在做比较的时候，遇到了如下问题：http://www.cnblogs.com/LoveJenny/archive/2011/08/01/2124233.html我自定义了 XmlDictionary&lt;TKey,TValue&gt; : Dictionary&lt;TKey,TValue&gt; , 没有重写GetHashCode ，发现 Distinct 不管用，没有调试进入 Equals 方法，但进入了 GetHashC</summary><published>2012-04-12T09:55:00Z</published><updated>2012-04-12T09:55:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2444405.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2444405.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/04/12/2443268.html</id><title type="text">实在看不懂MSDN关于 Any 的解释。</title><summary type="text">1.引用MSDN的AnyEnumerable.Any&lt;TSource&gt;方法 (IEnumerable&lt;TSource&gt;, Func&lt;TSource, Boolean&gt;)发送反馈确定序列中的任何元素是否都满足条件。命名空间：System.Linq程序集：System.Core（在 System.Core.dll 中）语法类型参数TSourcesource中的元素的类型。参数source类型：System.Collections.Generic.IEnumerable&lt;TSource&gt;一个IEnumerable&lt;T&gt;，其元素将应用谓词。p</summary><published>2012-04-11T17:58:00Z</published><updated>2012-04-11T17:58:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2443268.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2443268.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/04/12/2443239.html</id><title type="text">遇到一个面向对象无法解决的问题。</title><summary type="text">如下代码所示：public abstract class ReadOnlyRuleBase{ public abstract string GetName() ;}public abstract class RuleBase: ReadOnlyRuleBase{ public override string GetName() { return "MyTable" ;}}public class MyTable: RuleBase{ //我想在这里添加约束，一定要重写 GetName 方法。怎么办？}即： 孙类一定要继承某类的虚方法。后来，变通处理：public...</summary><published>2012-04-11T16:20:00Z</published><updated>2012-04-11T16:20:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2443239.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/04/12/2443239.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/03/13/2395169.html</id><title type="text">SQL 生成 Word 文档新思路.</title><summary type="text">目前是PowerDesigner 的唯一可用功能了吧,想个简单办法实现之。1.把数据导入到 Excel这种方式比较灵活,可以方便的利用 OleDb接口,从SQLServer元数据表读取数据,写入到 Excel2.把Excel导入到Word为了定义出哪是表描述,哪是列描述,可以人为的添加标记.如 表标记前有两个空行.表标记后有一个空行. 利用 DDE 或剪贴板,把数据导入到 Word.3.利用宏,美化Word灵活地利用宏,对Word进行美化.对Word自动生成标题,大纲等.灵活,强大,相信不比PD效果差.(待实现.)</summary><published>2012-03-13T15:08:00Z</published><updated>2012-03-13T15:08:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/03/13/2395169.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/03/13/2395169.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/03/04/2379274.html</id><title type="text">ReportViewer，RDLC 报表开发之个性化样式</title><summary type="text">报表开发中，客户对样式提出了要求：1.工具栏上显示每页条数2.只导出Excel，不需要下拉菜单。3.报表上显示的图表，分页时，每页都要显示，但导出后，图表是一个，且都在最下面。另外的功能点:4.每页显示标头5.标题行和 奇偶行样式解决方案：1.工具栏上显示每页条数 搜索无果后(RportViewer 没提供类似的功能吧.),暴力解决.好像网上也有类似的方案. /// &lt;summary&gt; /// 给报表添加每页条数. Udi 2012年3月2日 /// &lt;/summary&gt; /// &lt;param name="Report"&gt;&lt;/par</summary><published>2012-03-04T07:19:00Z</published><updated>2012-03-04T07:19:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/03/04/2379274.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/03/04/2379274.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/03/04/2379250.html</id><title type="text">ReportViewer，RDLC 报表开发之分页</title><summary type="text">前段时间开发报表,采用了 ReportViewer + RDLC , 开发整理如下.分页思路MS 的DataGrid ，GridView，和 ReportViewer 分页机制差不多，都需要绑定全部数据，MS控件自动处理分页。 只是ReportViewer 是按页面布局分页的，而不是按数据条数。绑定全部数据的方式会无谓的增加服务器压力，尤其是数据计算和表关联多的情况下。为了减轻服务器压力，我们采用数据分页，数据传到应用服务器端后，再加工一下（插入空数据），做也可分页数据源。如果数据库有 100 条数据，每页10条数据，那存储过程返回10条数据后，还需要再插入90条数据。当数据大的时候，插入的数</summary><published>2012-03-04T06:48:00Z</published><updated>2012-03-04T06:48:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/03/04/2379250.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/03/04/2379250.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/02/26/2368625.html</id><title type="text">Sql2008中添加程序集.</title><summary type="text">C# 建立数据库 CRL 项目 .Net 3.5public partial class MyClr{ [Microsoft.SqlServer.Server.SqlFunction] public static SqlBoolean CLRFBitContains(string MyBigIntValue, int Row) { // 在此处放置代码 return (new MyBigInt(MyBigIntValue) &amp; MyBigInt.CreateByBitPositon(Convert.ToUInt32(Row))) == MyBigI...</summary><published>2012-02-26T06:30:00Z</published><updated>2012-02-26T06:30:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/02/26/2368625.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/02/26/2368625.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2012/01/04/2312358.html</id><title type="text">jQuery Find速度很慢的调试.</title><summary type="text">最近发现一个页面速度很慢,IE8 下报脚本运行时间太长,是否要停止的警告. 定位到$(d).find(":text,textarea,:hidden,:password,:radio:checked") .在其它浏览器里没有问题, 只有 IE8 .继续查找,发现它会执行如下代码.在 jQuery 上执行 : sortOrder 函数 . // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for compari</summary><published>2012-01-04T10:44:00Z</published><updated>2012-01-04T10:44:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2012/01/04/2312358.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2012/01/04/2312358.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/12/26/2302198.html</id><title type="text">关于 没有从 DbType UInt16 到已知 SqlDbType 的映射。的Bug追踪.</title><summary type="text">public override DbType DbType{ get { return this.GetMetaTypeOnly().DbType; } set { MetaType type = this._metaType; if (((type == null) || (type.DbType != value)) || ((value == DbType.Date) || (value == DbType.Time))) { this.PropertyTypeChanging()...</summary><published>2011-12-26T08:02:00Z</published><updated>2011-12-26T08:02:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/12/26/2302198.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/12/26/2302198.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/12/20/2294865.html</id><title type="text">Mvc2.0 处理自定义错误.</title><summary type="text">遇到很奇怪的问题:新建Mvc2.0项目,添加新的Area,在 Area里的 Web.config 配置&lt;customErrors mode="On"/&gt; , 在Area里的Controller 加上 ErrorHandle , 在Shared里添加 Error.aspx.Action 抛一个错.显示正确的 Error.aspx 里的信息,没问题.在真实项目中, 不能通过. 显示 运行时错误,需要配置customErrors .到现在依然没有找到真正的原因.现只记录解决的结果(在此感谢 TomXu 的大力帮助 ):public class MyError : Ha</summary><published>2011-12-20T08:34:00Z</published><updated>2011-12-20T08:34:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/12/20/2294865.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/12/20/2294865.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/12/09/2282516.html</id><title type="text">安装 Microsoft Silverlight 4 Tools for Visual Studio 2010 时报错 的解决办法.</title><summary type="text">安装Microsoft Silverlight 4 Tools for Visual Studio 2010 时报错:安装需求:必须先安装与 Silverlight Tools 4 语言版本相一致的 Visual Studio 2010、Visual Web Developer 学习版 2010 或 Visual Phone Developer 学习版 2010，Silverlight Tools 的安装才能继续。以下网址提供了其他语言版本的 Silverlight Tools: &lt;A HREF="http://go.microsoft.com/fwlink/?LinkId=1</summary><published>2011-12-09T09:18:00Z</published><updated>2011-12-09T09:18:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/12/09/2282516.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/12/09/2282516.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/10/31/2229887.html</id><title type="text">C#,ASP.Net 开发笔记</title><summary type="text">1. 类方法与扩展方法的区别： TestClass test = null ; test.ExtendMethod() ; //扩展方法不报错， 可以在方法里判断对象是否为空。2.Serializable Attribute 和ISerializable 的区别： ISerializable 可以序列化整个对象的属性。包括父对象。 是比较完整的序列化。 3. 事件委托 还是 配置接口实现？ 底层要把功能开放到高层的实现方案： 一是 通过配置，在 Config中配置出 实现某接口的实现，在底层反射出对象实例（重点缓存对象），调用某方法。对于需要高层自定义代码很多的情况下，比较实用。 ...</summary><published>2011-10-31T02:40:00Z</published><updated>2011-10-31T02:40:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/10/31/2229887.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/10/31/2229887.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/10/21/2220362.html</id><title type="text">元数据的 GUID 和 MetadataToken</title><summary type="text">this.GetType().GUID 的作用域是 固定版本下的程序集。即，在相同版本的程序集中，类的GUID 是固定的；版本不同的程序集，其 GUID是不同的。this.GetType().MetadataToken 是程序集下的唯一表示。即，在同一程序集中，类的 MetadataToken 是固定的；和版本没关系。</summary><published>2011-10-21T07:40:00Z</published><updated>2011-10-21T07:40:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/10/21/2220362.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/10/21/2220362.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/10/21/2220335.html</id><title type="text">DateTime.Format 的一个Bug。</title><summary type="text">DateTime.Today.Format("yyyy/MM/dd") 产生的结果依赖于 系统的地区和语言中关于时间的设置。如果系统设置为 "yyyy/MM/dd" 则 结果为 2011/10/21如果系统设置为 "yyyy-MM-dd" 则结果为 2011-10-21强制转为 "yyyy/MM/dd" 的方法为：DateTime.Today.Format(@"yyyy\/MM\/dd") ;</summary><published>2011-10-21T07:26:00Z</published><updated>2011-10-21T07:26:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/10/21/2220335.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/10/21/2220335.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/09/29/2196034.html</id><title type="text">XmlDocument 创新对象时, 产生 xmlns=&amp;quot;&amp;quot; 的解决方案</title><summary type="text">1. 读取时,应该添加NameSpace. var exclDef = excl.SelectSingleNode(@"ns:worksheet/ns:sheetData", excl.GetNameSpaceManager("ns")); public static XmlNamespaceManager GetNameSpaceManager(this XmlDocument xml, string NameSpace) { XmlNamespaceManager nsmgr = new XmlNamespaceManag...</summary><published>2011-09-29T15:45:00Z</published><updated>2011-09-29T15:45:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/09/29/2196034.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/09/29/2196034.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/07/31/2123260.html</id><title type="text">在 VS 中,应用宏来定义自定义代码Copy</title><summary type="text">Imports SystemImports EnvDTEImports EnvDTE80Imports EnvDTE90Imports EnvDTE90aImports EnvDTE100Imports System.DiagnosticsImports MyCmnImports System.LinqImports System.IOPublic Module UdiModule Private ErrMsg As String Private SucessMsg As String Sub Test() Dim selection As EnvDTE.Tex...</summary><published>2011-07-31T14:56:00Z</published><updated>2011-07-31T14:56:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/07/31/2123260.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/07/31/2123260.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/06/20/2085500.html</id><title type="text">MS 报表 笔记 .</title><summary type="text">1.每页固定表头:http://hi.baidu.com/godgod/blog/item/8170364e80b095c4d0c86a53.html2.按指定条数分页:http://blog.csdn.net/jameszhou/archive/2007/08/29/1763397.aspx</summary><published>2011-06-20T12:33:00Z</published><updated>2011-06-20T12:33:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/06/20/2085500.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/06/20/2085500.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/newsea/archive/2011/06/12/2078864.html</id><title type="text">导出带有复合表头的Excel方案.</title><summary type="text">原则1.不要求服务器安装Excel . 使布署简单.2.制作复杂表头,也不操作COM所以方案如下:1. 使用 OleDb 的方式生成标准SQL , 以Excel 做为数据源.很容易插入二维数据. Insert Into Db ( A , B ,C ) values ( '1', 'Hello', 'world') ;2. 提前做好Excel 表. 有两个Sheet . 第一个Sheet 以实际业务的中文名命名(如 报表). 第二个Sheet 固定名称: Db报表的Sheet 制作复杂表头. 然后,用公式 =IF(Db!A1="&amp;quot</summary><published>2011-06-12T06:08:00Z</published><updated>2011-06-12T06:08:00Z</updated><author><name>NewSea.</name><uri>http://www.cnblogs.com/newsea/</uri></author><link rel="alternate" href="http://www.cnblogs.com/newsea/archive/2011/06/12/2078864.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/newsea/archive/2011/06/12/2078864.html"/><content type="html"/></entry></feed>
