.Net编程栏目主要是记录我在开发碰到的一些问题及解决方法。主要的内容是关于使用.Net框架开发Web程序的。主要涉及的内容有C#,Asp.Net 2.0,Asp.Net Mvc 3.0,Entity FrameWork等。 其中一些内容可能来自其他人的解决方案。所以方法不是原创的,但都是有用的,希望改大家提供参考。
WordXML格式初步分析
前言
Office2003以上,Word可以以XML文本格式存储,这样就可以使用外部程序创建Word文件,而不需要使用Word的对象。也能够自由的打开分析Word文件,或者发布到自己的Web页面,或者其他更多应用。
一个典型的WordXML结构可以是如下的样子:
<?xml version="1.0"?><w:wordDocument … more
在Entity Framework 4.1中直接直接执行sql语句和存储过程
执行SQL查询返回Entities
using (var context = new SchoolEntities()){ var departments = … more
Compile Views in Asp.Net MVC 3 with Visual Studio
Why compiled views?
First of all I prefer VS.NET to compile the cshtml code at build time because it will notice syntax errors like on any .cs file. Syntax errors are most important when I have to do … more
Entity Framework 4 (EF4) Adventures
Intro
I've been recently working on a smart client (WinForms) application backed by Entitiy Framework 4 (EF4) on Visual Studio 2010. In this blog post I will try to give you some tips regarding some … more
Entity Framework框架Code First Fluent API
在Code First方法中,还可以通过Fluent API的方式来处理实体与数据表之间的映射关系。
要使用Fluent API必须在构造自定义的DbContext时,重写OnModelCreating方法,在此方法体内调用Fluent API。
如下面代码所示:
public class BlogDbContext : DbContext { public … more
asp.net mvc使用jquery.from ajax上传文件 然后返回json
本来,通过jquery from,ajax上传文件挺容易的,但是,上传完之后想返回json的话,颇费了一些周折。
asp.net mvc 中可以直接返回一个JsonResult,例如
代码