摘要:1.controller写法:public ActionResult Index(int id = 1){ using (var db = new NORTHWNDEntities()) { PagedList orders = db.Orders.OrderBy(o=>o.OrderID).ToPagedList(id, 20); return View(orders); }}2.前台页面:@{ ViewBag.Title = "MvcPager标准Url分页";}@model PagedList MvcPager标准Url分页订单编号订单日期顾客编号收货地址@fo
阅读全文
摘要:1.下载nginxhttp://nginx.org/en/download.html2.启动、停止nginx启动:C:\server\nginx-1.0.2>start nginx.exe停止:C:\server\nginx-1.0.2>nginx.exe -s stop3.添加项目路径 修改conf文件夹下面的nginx.conf文件server { listen 8086; server_name localhost; location / { root D:\WebSites\test1; index Default.aspx; proxy_pass http://127.0
阅读全文
摘要:1.新建一个空白的rpt文件2. 在服务器资源管理下面新建数据连接,并新建一个XSD文件,然后从前面新建的连接里面把一张表拖到XSD文件里面3.在数据库专家里面把前面的表放到选定的表里面4. 把相应的字段放到rpt文件里面5.新建WebForm放入CrystalReportViewer6.添加代码protected void Page_Load(object sender, EventArgs e){ SqlConnection mycon = getcon();//获取连接对象 mycon.Open();//打开连接 SqlDataAdapter da = new SqlDataAda...
阅读全文
摘要:1.类别映射[ActiveRecord("Catalog")]public class Catalog: ActiveRecordBase{ [PrimaryKey] public int CatalogId { get; set; } [Property] public string Name { get; set; } [HasMany] public IList MovieList{ get; set; }}[ActiveRecord("Movies")]public class Movies : ActiveRecordBase{ [Primar
阅读全文
摘要:1.下载软件http://www.castleproject.org/activerecord/gettingstarted/index.htmlhttp://www.castleproject.org/castle/download.html2.配置文件appconfig.xml 3.Global.asaxvoid Application_Start(object sender, EventArgs e) { XmlConfigurationSource source = new XmlConfigurationSource(Server.MapPath("~/appconfi..
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using MongoDB;namespace TestMongodb{ public partial class _Default : System.Web.UI.Page { //链接字符串 string connectionString = "mongodb://localhost"; //数据库名 str
阅读全文
摘要:1.文件路径\App_Data\Entity\DEP.cs\App_Data\Entity\NHibernateHelper.cs(参考官方文档)\App_Data\Mapping\DEP.hbm.xml\bin\hibernate.cfg.xml2.hibernate.cfg.xml文件 NHibernate.Driver.OracleClientDriver User ID=kenny1;Password=123456;Data Source=orcl false NHibernate.Dialect.Oracle10gDialect true 1, false 0,...
阅读全文