摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.Data;public class SQLHelper{ /// <summary> /// 插入单个实例 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="entity"> 阅读全文
posted @ 2012-04-22 22:35 第7笔画 阅读(1124) 评论(0) 推荐(0) 编辑
摘要: using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Reflection;namespace System.Data{ public static class DataTableHelper { #region 利用反射把DataTable的数据写到单个实体类 public static T ToSingleEntity<T>(this System.Data.DataTable dtSource) { if (dt... 阅读全文
posted @ 2012-04-22 22:33 第7笔画 阅读(679) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;public class DBHelperSQL{ /// <summary> /// 数据库连接字符串 /// </summary> private static string _conStr = System.Configuration.ConfigurationManager.ConnectionStrings[ 阅读全文
posted @ 2012-04-22 22:30 第7笔画 阅读(268) 评论(0) 推荐(0) 编辑