随笔分类 -  .NET

摘要:CommandParameter="{Binding}"改为CommandParameter="{Binding DataContext,RelativeSource={RelativeSource Self}}" ... 阅读全文
posted @ 2019-01-08 16:06 I'm CY 阅读(255) 评论(0) 推荐(0)
摘要:参考: https://wpf.2000things.com/2017/04/06/1204-using-a-datatrigger-to-change-content-in-a-contentpresenter/ ContentControl通过DataTrigger进行切换模板时,原来绑定的模板 阅读全文
posted @ 2018-12-18 21:08 I'm CY 阅读(678) 评论(0) 推荐(0)
摘要:When calling DbContext.SaveChanges, I get a DbUpdateException:An unhandled exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occ 阅读全文
posted @ 2018-04-03 15:12 I'm CY 阅读(309) 评论(0) 推荐(0)
摘要:C# javascript 采用 RSA 加密解密1.C#提供公钥2.javascript用公钥加密3.C#用私钥解密4.javascript 类库 https://www.pidder.de/pidcrypt/ prot... 阅读全文
posted @ 2015-08-17 17:46 I'm CY 阅读(1052) 评论(0) 推荐(0)
摘要:http://social.msdn.microsoft.com/Forums/vstudio/en-US/d0bcb415-fb1e-42e4-90f8-c43a088537fb/aborting-a-long-running-task-in-tpl?forum=parallelextensionsI hesitate to show this :), but if you really did want to use aborts, you could do something like:int Foo(CancellationTokentoken){Threadt=Thread.Curr 阅读全文
posted @ 2013-11-14 22:48 I'm CY 阅读(242) 评论(0) 推荐(0)
摘要:http://stackoverflow.com/questions/12424537/why-ienumerablet-is-defined-as-ienumerableout-t-not-ienumerabletThe out type parameter specifier denotes covariance.In practice,If I define two interfaces.ISomeInterface<T>{}ISomeCovariantInterface<out T>{}Then, I implement them like this.SomeC 阅读全文
posted @ 2013-05-17 10:40 I'm CY 阅读(269) 评论(0) 推荐(0)
摘要:[Serializable]public class MyViewModel : IEditableObject{ [NonSerialized] private object[] _copy; public MyViewModel() { Name = string.Empty; } public int Age { get; set; } public string Name { get; set; } public void BeginEdit() { //take a copy of curren... 阅读全文
posted @ 2013-04-14 21:36 I'm CY 阅读(231) 评论(0) 推荐(0)
摘要:decimal 的字段在Avg的时候报出异常:枚举值太大,不能适应96 位十进制。改为round(avg(value),2)问题解决。 阅读全文
posted @ 2011-06-26 23:16 I'm CY 阅读(390) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/teamleader/archive/2011/01/25/1944810.html 你可能不知道的对象实例化顺序 猜猜下面这段代码的输入,我预计90%以上的人给不出正确的答案 voidMain(){ InitSeqBase x =newInitSeqChild();}publicclassInitSeqBase{ publicstaticNothi... 阅读全文
posted @ 2011-01-26 09:46 I'm CY 阅读(195) 评论(0) 推荐(0)
摘要:http://weblogs.asp.net/whaggard/archive/2005/02/20/377025.aspx Matching Balanced Constructs with .NET Regular Expressions Brief Computer Science Theory Background In computer science aformal language... 阅读全文
posted @ 2010-12-08 15:29 I'm CY 阅读(315) 评论(0) 推荐(0)
摘要:http://blogs.msdn.com/dsimmons/pages/ef-faq-query.aspxC#static Expression<Func<TElement, bool>> BuildContainsExpression<TElement, TValue>( Expression<Func<TElement, TValue>&... 阅读全文
posted @ 2010-01-07 21:02 I'm CY 阅读(568) 评论(0) 推荐(0)
摘要:测试方法 TestProject1.SysTest.HtmlAnalysisTest12 引发异常: System.Data.UpdateException: 更新项时出错。有关详细信息,请参阅“InnerException”。 ---> System.Data.SqlClient.SqlException: 传入的表格格式数据流(TDS)远程过程调用(RPC)协议流... 阅读全文
posted @ 2010-01-03 21:24 I'm CY 阅读(1446) 评论(0) 推荐(0)
摘要:很有用类,总是忘,记录一下。默认情况下,Stopwatch 实例的运行时间值相当于所有测量的时间间隔的总和。每次调用 Start 时开始累计运行时间计数;每次调用 Stop 时结束当前时间间隔测量,并冻结累计运行时间值。使用 Reset 方法可以清除现有 Stopwatch 实例中的累计运行时具体可以参看MSDN 阅读全文
posted @ 2009-10-10 14:58 I'm CY 阅读(276) 评论(0) 推荐(0)
摘要:异常==========================用户代码未处理 System.Security.SecurityExceptionMessage="请求“System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限已失败。"Source="mscorlib"StackTrace: 在 System.Security.CodeAccessSecurityEn 阅读全文
posted @ 2009-06-29 19:21 I'm CY 阅读(507) 评论(0) 推荐(0)
摘要:VS2008中设计.dbml文件时,如果选择“保存”“数据库连接字符串”,这些信息会存储在Propreties/Settings.settings.cs文件中。想在发布的时候更改连接字符串,该如何做?其实,秘密都在app.config文件中.VS2008在产生Settings.settings的同时,此文件中的信息已经存储在app.config,我们... 阅读全文
posted @ 2009-04-18 07:36 I'm CY 阅读(1323) 评论(0) 推荐(0)
摘要:经常上天涯,写了一个下载文字贴的东西,很丑陋,有需要的朋友自己下吧. 引用第三方控件 8.2.2版本 http://download.csdn.net/source/578378 阅读全文
posted @ 2008-08-23 17:08 I'm CY 阅读(815) 评论(0) 推荐(0)
摘要:1 private void simpleButton1_Click(object sender, EventArgs e) 2 { 3 List list = new List(); 4 int[] ary = new int[] { 1,1,1,1,2,2,2,3,3,3,4,4,4}; 5 6 ... 阅读全文
posted @ 2008-03-27 15:45 I'm CY 阅读(431) 评论(0) 推荐(0)
摘要:原文 http://tomasp.net/blog/cannot-return-anonymous-type-from-method.aspx TESTCODE: 1 private void button1_Click(object sender, EventArgs e) 2 { 3 IEnumerable list = GetAA... 阅读全文
posted @ 2008-03-25 12:35 I'm CY 阅读(408) 评论(0) 推荐(0)
摘要:http://www.6suv.com/20070529/13487/ dll添加到GAC,在C:\WINDOWS\assembly下可以看到,但在添加引用里看不到 方案一:在“添加引用”对话框中显示程序集 即使已将程序集安装到全局程序集缓存 (GAC) 中,“添加引用”对话框也不会自动显示每个程序集。“添加引用”对话框基于路径并要求添加注册表项,该项指定要显示的程序集的位置。 在“添加引用... 阅读全文
posted @ 2007-12-26 09:03 I'm CY 阅读(1048) 评论(1) 推荐(1)
摘要:在应用MDI过程中发现,MDI的自窗体Load事件写Close报错。 未处理的“System.InvalidOperationException”类型的异常出现在 system.windows.forms.dll 中。 其他信息: 执行 CreateHandle() 时无法调用 Close()。 通过Google找到解决方案。 http://objectsharp.com/blogs/da... 阅读全文
posted @ 2006-07-29 17:24 I'm CY 阅读(495) 评论(0) 推荐(0)