摘要: 截取字符串 //从string 拷贝操作 string str = "0123456789"; string str2 = str.substr(3, 5);//值拷贝 偏移位置,长度 str2 = str.substr(3);//从偏移位置拷贝到最后 //从char指针拷贝 char *c = " 阅读全文
posted @ 2022-03-11 11:52 zq爱生活爱代码 阅读(872) 评论(0) 推荐(0) 编辑
摘要: 正常使用的话,必须导入 #include <assert.h>,这样才能在后面使用断言 如果要使断言失效,就必须在assert.h前面新增 NDEBUG,注意!!!!必须紧随上面新增,跨行都不行 #define NDEBUG#include <assert.h> 阅读全文
posted @ 2022-02-17 08:45 zq爱生活爱代码 阅读(88) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; using System.Web.Mvc 阅读全文
posted @ 2022-01-25 08:11 zq爱生活爱代码 阅读(38) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 全選 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button4_Click(object sender, EventArgs 阅读全文
posted @ 2022-01-19 08:24 zq爱生活爱代码 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 1.设定 dataGridView1.AutoGenerateColumns = false; 2.清空 dataGridView1.DataSource = null; 阅读全文
posted @ 2022-01-18 16:42 zq爱生活爱代码 阅读(322) 评论(0) 推荐(0) 编辑
摘要: using (var dc = new SchoolContext()) { ////GRADE g = new GRADE() { GradeId=2 }; //var greadeinfo = dc.Grades.Find(2); //STUDENT stu = new STUDENT() { 阅读全文
posted @ 2022-01-09 16:42 zq爱生活爱代码 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 应该通过上下午对象来保存数据,而不是创建一个新的对象 using (var dc = new SchoolContext()) { //GRADE g = new GRADE() { GradeId=2 }; var greadeinfo = dc.Grades.Find(2); STUDENT s 阅读全文
posted @ 2022-01-06 19:55 zq爱生活爱代码 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 1.插入时,提示 無法將 NULL 插入 原因:默认情况,ef认为只要实体类中有ID属性,数据库对应的是一定是自增标识列。 解决方式有两种 1.1. OnModelCreating 里面新增 modelBuilder.Entity<STUDENT>().Property(p => p.STUDENT 阅读全文
posted @ 2022-01-02 15:00 zq爱生活爱代码 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 创建单表插入 1.安装 设定DB连接 <connectionStrings> <add name="connstr" providerName="Oracle.ManagedDataAccess.Client" connectionString="Password=XXX;User ID=XXXX; 阅读全文
posted @ 2022-01-02 14:05 zq爱生活爱代码 阅读(70) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; usin 阅读全文
posted @ 2022-01-01 05:27 zq爱生活爱代码 阅读(31) 评论(0) 推荐(0) 编辑