李空

博客园 首页 新随笔 联系 订阅 管理

2013年12月23日 #

摘要: //连接语句public readonly string sqlconn = ConfigurationManager.ConnectionStrings["Transaction_9_30ConnectionString"].ConnectionString;//ExecuteQueryLinqToSqlDataContext LinqToSql = new LinqToSqlDataContext(sqlconn); //var result = from query in LinqToSql.Class select query; List r... 阅读全文
posted @ 2013-12-23 19:54 李空 阅读(1040) 评论(0) 推荐(0)

2013年12月21日 #

摘要: //SelectMany List> Numbers = new List>() { new List{1,2,3}, new List{4,5,6}, new List{7,8,9} }; var result = Numbers.SelectMany(a => a); foreach (var nubers in result) { Cons... 阅读全文
posted @ 2013-12-21 16:12 李空 阅读(365) 评论(0) 推荐(0)

2013年12月20日 #

摘要: public static DataTable CopyToDataTable(this IEnumerable array) { var ret = new DataTable(); foreach (PropertyDescriptor dp in TypeDescriptor.GetProperties(typeof(T))) { //if (!dp.IsReadOnly) { ret.Columns.Add(d... 阅读全文
posted @ 2013-12-20 16:31 李空 阅读(214) 评论(0) 推荐(0)

摘要: LinqtoSqlDataContext Linq = new LinqtoSqlDataContext(ConfigurationManager.ConnectionStrings["sz_imt20131024pmConnectionString"].ConnectionString);DataContext对象var query = from usersTable in Linq.UsersTable where usersTable.Uid > 1&&usersTable.Username.StartsWith("张") . 阅读全文
posted @ 2013-12-20 15:49 李空 阅读(161) 评论(0) 推荐(0)

2013年12月16日 #

摘要: 1 public static int Reg(Model ml) 2 { 3 bool b = true; 4 Visit vt = new Visit(); 5 StringBuilder builder = new StringBuilder("insert into UsersTable ("); 6 Type type = ml.GetType(); 7 PropertyInfo[] per = type.GetProperties(); 8 ... 阅读全文
posted @ 2013-12-16 17:24 李空 阅读(463) 评论(0) 推荐(0)

2013年12月13日 #

摘要: 前台页面: View Code ashx文件代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace WebApplication1{ /// /// Handler1 的摘要说明 /// public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { ... 阅读全文
posted @ 2013-12-13 15:47 李空 阅读(794) 评论(0) 推荐(0)

2013年12月12日 #

摘要: 前台代码: View Code Webservice代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Script.Serialization;namespace WebApplication1{ /// /// WebService1 的摘要说明 /// [WebService(Namespace = "http://tempuri.... 阅读全文
posted @ 2013-12-12 22:24 李空 阅读(1696) 评论(0) 推荐(0)

2013年12月11日 #

摘要: public static string CreateJsonParameters(DataTable dt,string JsonName) { StringBuilder JsonString = new StringBuilder(); if (dt != null && dt.Rows.Count > 0) { JsonString.Append("{ "); JsonString.Append("\""+JsonName+"\":[ "... 阅读全文
posted @ 2013-12-11 19:48 李空 阅读(287) 评论(0) 推荐(0)

2013年12月10日 #

摘要: 简单实用 阅读全文
posted @ 2013-12-10 00:43 李空 阅读(206) 评论(0) 推荐(0)

摘要: 前台代码: 商品编号 商品名称 --%> 后台代码:protected string... 阅读全文
posted @ 2013-12-10 00:12 李空 阅读(356) 评论(0) 推荐(0)