上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页
摘要: System.InvalidOperationException: The type MyContext+Northwind was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit 阅读全文
posted @ 2013-01-04 12:17 陈哈哈 阅读(1231) 评论(0) 推荐(0)
摘要: 本文使用一个控制台工程来测试虚拟属性,下面是完整的控制台程序代码。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace VisualProperty 7 { 8 class Program 9 {10 static void Main(string[] args)11 {12 MyBaseClass mbc = new MyBaseClass();13 ... 阅读全文
posted @ 2013-01-03 21:13 陈哈哈 阅读(486) 评论(0) 推荐(0)
摘要: ·Required —指示属性是一个必需的字段·DisplayName定义我们想要用在表单字段和验证消息的文本·StringLength——定义了一个最大长度为一个字符串字段·Range——限定一个数值字段的范围·Bind——列表字段来排除或包含绑定的参数或表单值模型属性·ScaffoldColumn——允许从editor forms中隐藏字段 阅读全文
posted @ 2013-01-03 20:46 陈哈哈 阅读(367) 评论(0) 推荐(0)
摘要: html.ActionLink生成一个<a href=".."></a>标记。而Url.Action只返回一个url。例如:@Html.ActionLink(“链接文本”、“someaction”、“somecontroller”,new { id = " 123 " },null)生成:< a href = " / somecontroller / someaction / 123 " >链接文本</a> ======================================== 阅读全文
posted @ 2013-01-03 20:24 陈哈哈 阅读(20372) 评论(0) 推荐(3)
摘要: 4013BD各连接点说明: SD1是置1端,CD1是置0端,D1是输入端,CP1是时钟输入端,O1=D1,~O1=-O1MS10工程文件 阅读全文
posted @ 2013-01-03 18:25 陈哈哈 阅读(3084) 评论(0) 推荐(0)
摘要: 1 <!DOCTYPE HTML> 2 <html> 3 4 <body> 5 6 <fieldset> 7 <legend>健康信息:</legend> 8 <form> 9 <p><label>身高:<input type="text" /></label></p>10 <p><label>体重:<input type="text" /></label>< 阅读全文
posted @ 2013-01-03 15:49 陈哈哈 阅读(1078) 评论(0) 推荐(0)
摘要: 线程同步傻问题:该被同步的变量没有用信号量控制,值是否会被改变 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 7 namespace testLockList 8 { 9 class Program10 {11 12 const int ThreadMaxNum = 5; //要启动的线程的最大数目13 static ... 阅读全文
posted @ 2013-01-02 01:26 陈哈哈 阅读(645) 评论(0) 推荐(0)
摘要: 本文主要用来说明多线程中异常情况的处理。 问题出现:使用Lock进行多线程中的同步的时候,如果在Lock块里面出现了异常,那么同步的资源(变量)就没有办法被释放,最终将导致线程死锁。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 7 namespace testLockList 8 { 9 class Program10 {11 12 const int ... 阅读全文
posted @ 2013-01-02 00:35 陈哈哈 阅读(726) 评论(0) 推荐(0)
摘要: 多线程的调试一直是一个令人蛋疼的问题,一般的解决方法是写Log。有的时候想要直观地看一下线程的运行状态,简直是困难。幸好vs2010给我们提供了一个多线程窗口。使用方式:1、按F5进入调试状态下2、按图1所示打开多线程窗口图1打开多线程窗口3、运行效果(见图2)图2 运行效果 阅读全文
posted @ 2013-01-01 22:01 陈哈哈 阅读(17288) 评论(0) 推荐(2)
摘要: 本错误的环境是.Net4.0,数据库访问使用LinQ。本例在数据库访问的类里面将DBAccessDataContext(数据库上下文)做为类变量,后面的数据库操作函数都使用这个类变量,在多线程的环境下面就爆出了[System.InvalidOperationException] = {"阅读器关闭时尝试调用 MetaData 无效。"} 的错误。具体的代码见下方作为类变量的DBAccessDataContext1 public class test1 { 2 DBAccessDataContext db = new DBAccessDataContext()3 4 pub. 阅读全文
posted @ 2013-01-01 12:17 陈哈哈 阅读(3319) 评论(0) 推荐(1)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页