在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
使用背景如下 A表 #1字段 储存数据 "1|2013/10/12 12:33:55,2|2013/10/13 08:21:34,3|2013/10/14 19:41:57" B表 #1 #2字段 储存数据 "1" "A" "2" "B" "3" "C" 为了方便读取,将A表 #1读取切割,随后储存在 List<Model.C>中 public class C { public C(int id,DateTime date) { this.ID = id; this.Date = date; } private int _id; private DateTime _date; public int ID { set { _id = value } get { return _id } } public DateTime Date { set { _date= value } get { return _date } } } List<Model.C> cList = new List<Model.C>(); if (!string.IsNullOrWhiteSpace(A.#1)) { string[] AList= A.#1.Split(','); for (int i = 0; i < AList.Length; i++) { string[] ALists = AList[i].Split('|'); cList.Add(new Model.C(Convert.ToInt32(ALists[0]), Convert.ToDateTime(ALists[1]))); } } Model.C cFind = cList.Find(delegate(Model.C cIndex) { return cIndex.ID== B.#1; });
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论