写到到数据库的模型 using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace ...
我是先写的Model的表: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Compone ...
分类:
其他好文 时间:
2020-07-26 22:51:44
阅读次数:
79
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Text; using System.Drawing; using System.IO; namespa ...
//创建一个空表 DataTable dt = new DataTable(); dt.Columns.Add("日期", typeof(DateTime)); dt.Columns.Add("类别", typeof(String)); dt.Columns.Add("科室", typeof(Str ...
分类:
其他好文 时间:
2020-07-24 22:02:37
阅读次数:
71
public class OfficeHelper { private static bool ReadExcelToDataTable(ISheet sheet, ref string strMsg, out DataTable data) { bool bRet = true; //定义要返回的 ...
分类:
其他好文 时间:
2020-07-22 16:26:44
阅读次数:
90
一:背景 1. 讲故事 最近因为各方面原因换了一份工作,去了一家主营物联柜的公司,有意思的是物联柜上的终端是用 wpf 写的,代码也算是年久失修,感觉技术债还是蛮重的,前几天在调试一个bug的时候,看到了一段类似这样的代码: var dt = new DataTable(); SqlDataAdap ...
分类:
数据库 时间:
2020-07-22 11:41:35
阅读次数:
80
1、左连接: var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals dept.ID into JoinedEmpDept from dept in JoinedEmp ...
分类:
其他好文 时间:
2020-07-21 23:18:05
阅读次数:
103
#1 linq介绍 ##1.1 linq产生背景 一个应用服务后台程序,肯定会需要格式各样的数据检索跟操作,而这些数据在过去的这些年里一般都会包含在关系型数据库或者xml文件中。 .Net3.5版本发行之前,传统的数据源访问方式就是直接对数据库或者xml文件进行检索操作。在.Net3.5 Visua ...
分类:
其他好文 时间:
2020-07-21 22:24:15
阅读次数:
64
1.DataTable转List // 实体转换辅助类 datatable to list public class ModelConvertHelper where T : new() { public static List ConvertToModel(DataTable dt) { // 定 ...
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; using System.Net;using System.Net.Sock ...