• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
缎雨
博客园 首页 新随笔 联系 订阅 订阅 管理
上一页 1 2 3 4 5 6 7 8 下一页

2013年9月3日

var self = this //指代本作用域的对象
摘要: var self = this //指代本作用域的对象 我们给出一个私有的 self 参数。这个可以令对象对私有方法可见。这种做法是因为私有方法无法被公共方法调用。要令私有方法有用它们被附加到了对象上,但它们无法从外部访问,同时它们也无法被这个对象的公共方法(prototype方法都是公有的)所访问。他们只对私有成员可见。私有方法则是构造器内部的函数。ECMAScript Language Specification中的一个错误,这个错误令 this 不能正确地对内部函数设置。 functionClass1(){//self(self被附加到了对象上)self只对私有成员可见(能.点出来ia. 阅读全文
posted @ 2013-09-03 15:45 缎雨 阅读(390) 评论(0) 推荐(0)
 
 

2013年9月2日

Newtonsoft.Json设置日期格式定义
摘要: Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";string json = Newtonsoft.Json.JsonConvert.SerializeObject(ds, timeCon 阅读全文
posted @ 2013-09-02 11:53 缎雨 阅读(1344) 评论(0) 推荐(0)
 
 

2013年8月31日

此类目的是防治序列化Json字符串时的循环引用问题-------最好解决方案
摘要: using Newtonsoft.Json;using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace AccpStudentMIS{ //此类目的是防治序列化Json字符串时的循环引用问题 //此类为Object类的扩展方法,需要引用Newtonsoft.Json.dll类 //使用方法:在Controller中调用 Content(对象.ToJsonString(), "text/html;charset=UTF-8");方法来返回Json publ 阅读全文
posted @ 2013-08-31 12:07 缎雨 阅读(316) 评论(0) 推荐(0)
 
使用 Entity Framework 返回 JsonResult 时循环引
摘要: 使用 Entity Framework 返回 JsonResult 时循环引用的避免。发表时间: 2011-03-23 06:29:17 | 评论: 3 | 查看: 340 | 来自: LUKIYA_NEVERLAND最近在做公司的一个Dealer WHOLE SALE系统,使用了Entity Framework MVC3,在返回JsonResult时遇到了循环引用的问题。刚开始使用 [ScriptIgnore] 来避免此问题,可是发现Designer.cs改动时会把这个属性给自动删除,继续查阅了很多资料,自定义了一个JavaScriptConverter解决了问题,下面是代码。 public 阅读全文
posted @ 2013-08-31 11:42 缎雨 阅读(459) 评论(0) 推荐(0)
 
 

2013年8月27日

把sesssion放到 controller
摘要: 首先 在controller里面 登录 成功 把sesssion放到 controller01MinZui.Model.User.T01_UserCore loginUser = userWorker.Login(param);02 if (loginUser == null)03 {04 return View("Register");05 }06 else07 {08 //写入session09 //MoodSoft.Utility.Web.SessionHelper.SetSession("loginUser",... 阅读全文
posted @ 2013-08-27 09:22 缎雨 阅读(235) 评论(0) 推荐(0)
 
 

2013年8月26日

json webservice
摘要: 这很常用,搜索了 一下博客园的“找找看”和谷歌,看到大部分都是转载于一两篇文章(而且来源还不是博客园),有的是简单的说一点无法运行,给初学者的调试和学习带来不方 便,我在这里将jQuery Ajax 调用Aspx.Net WebService 的几个常用的方法做了一个整理,提供给正在找这方面内容的博友,希望能给学习jQuery的朋友一点帮助,可以直接复制代码运行。附件: 你需要登录才可以下载或查看附件。没有帐号? 注册ws.aspx 代码 jQuery 的WebServices 调用 HelloWorld 传入参数 ... 阅读全文
posted @ 2013-08-26 11:08 缎雨 阅读(323) 评论(0) 推荐(0)
 
 

2013年8月24日

触发器--游标--示例
摘要: create table bank(cname nvarchar(10) primary key not null,cmoney money )goinsert into bank values('张三',1000);insert into bank values('李四',1);gocreate table trans(id int identity(1,1) primary key not null,cname nvarchar(10),ctype nchar(2),tmoney money) ;alter table bank add constraint 阅读全文
posted @ 2013-08-24 09:43 缎雨 阅读(249) 评论(0) 推荐(0)
 
 

2013年8月13日

Linq-Detach方法--删除对象的时候如有关系导制错误去关系
摘要: public static void Detatch(Object entity) { Type t = entity.GetType(); System.Reflection.PropertyInfo[] properties = t.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); foreach (var property in properties) { string name = property.Name; if (property.Prop 阅读全文
posted @ 2013-08-13 11:47 缎雨 阅读(305) 评论(0) 推荐(0)
 
DatabaseExtensions 扩展方法 查询视图
摘要: using System;using System.Collections;using System.Collections.Generic;using System.Data;using System.Data.Entity;using System.Linq;using System.Reflection;using System.Reflection.Emit;using System.Text;using System.Threading.Tasks; public static class DatabaseExtensions { public static IEnumerable 阅读全文
posted @ 2013-08-13 11:18 缎雨 阅读(340) 评论(0) 推荐(0)
 
在C#中执行带有GO的批量sql语句
摘要: 在C#中执行带有GO的批量sql语句思海网络 出品()在用C#中调用ADO执行批量SQL语句的时候,会出现无法识别GO语句的错误。这个时候,我们以GO语句为分割点,把整个批量语句分割成N块独立的SQL语句代码块(不包含GO语句),然后再顺序执行每一块代码。要是Go很少,可以把整个sql,以go为分割点,拆成N个sql1,sql2,sql3……再用SqlCommand的CommandText=sql1,sql2,sql3……一个个执行!编程实现方法如下:System.Data.SqlClient.SqlCommand sqlCommand = new System.Data.SqlClient. 阅读全文
posted @ 2013-08-13 11:14 缎雨 阅读(1635) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 5 6 7 8 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3