08 2021 档案
摘要:解决方案: 可以用try--catch语句来发现哪个地方出错。 如: try { } catch (DbEntityValidationException ex) { } 通过监视ex对象就能发现哪个数据与数据库里的字段不匹配:
阅读全文
摘要:1.问题: 2.解决方案:
阅读全文
摘要:举个例子: 后端代码如下: using System.Collections.Generic; using System.Web.Mvc; namespace _2021DemoSite.Controllers { public class PostLoadDiffController : Cont
阅读全文
摘要:出问题的代码段: list.Where(q => q.City.Contains(city)).ToList() 解决问题给相应的字段加上ToString(): list.Where(q => q.City.ToString().Contains(city)).ToList()
阅读全文
摘要:1.数组转为字符串 string[] arrIds={"A","B","C"}; string strIds= string.Join(",", arrIds); 2.字符串转为数组 string strIds="A,B,C"; var arr = strIds.Split(',');
阅读全文
摘要:注意底下代码中column(index)索引是从0开始,而且是按照自己datable中定义的columns:[{},{},{}]里的列数和列顺序,而不是按照我们页面里看到的列数和列顺序 $(document).ready(function () { $('#myTable').dataTable()
阅读全文
摘要://1.声明及赋值 Dictionary<string, ulong> keyValues = new Dictionary<string, ulong>(); keyValues.Add("A", 3); keyValues.Add("B", 13); keyValues.Add("C", 23)
阅读全文
摘要:下面的文章摘自: https://nwpie.blogspot.com/2017/05/5-aspnet-mvc.html 他将生命周期分两个来探讨 1)The application life cycle应用程序级别的? 2)The request life cycle用户请求级别的? 一、The
阅读全文
摘要:添加列: alter table tableA add columnA bit null 删除列: ALTER TABLE tableA drop column columnA
阅读全文
摘要:添加DEFAULT 约束: ALTER TABLE [dbo].[tableA] ADD CONSTRAINT [DF_tableA_columnA] DEFAULT ((11)) FOR [columnA] 撤销 DEFAULT 约束: ALTER TABLE [dbo].[tableA] dro
阅读全文
摘要:create procedure insertRecord as declare @ID int set @ID=1 while(@ID<82) begin INSERT INTO tableA (columnA,columnB,columnC,columnD, columnE,columnF) v
阅读全文
摘要:select columnA,columnB,columnC,columnD,columnE,columnF, COUNT(columnA) from tableA where ... group by columnA,columnB,columnC,columnD,columnE,columnF
阅读全文