〇.建表数据 drop table if exists user_profile; CREATE TABLE `user_profile` ( `id` int NOT NULL, `device_id` int NOT NULL, `gender` varchar(14) NOT NULL, `age` int , `university` varchar(32) NOT NULL, `province` varchar(32) NOT NULL); INSERT INTO user_prof
使用NPOI 操作Excel 个人使用的电脑基本默认安装Excel 操作起来 调用Excel的组件便可.如果是一台服务器.没有安装Excel,也就无法调用Excel组件. 在此推荐第三方插件.NPOI 支持XLS(2007)和XLSX(2012)读写. using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using System.Collections.Gener
实现: 点击button1,从数据库中获得数据,指定数据库的某列数据插入到DataGridView指定列 一.双击button1进入事件代码 private void button1_Click(object sender, EventArgs e) { using (SQLiteConnection con = new SQLiteConnection(Constants.DATA_SOURCE)) { con.Open(); using (SQLiteCommand cmd = new SQ
django获取指定列的数据 model一般都是有多个属性的,但是很多时候我们又只需要查询特定的某一个,这个时候可以用到values和values_list [values()](https://docs.djangoproject.com/en/1.9/ref/models/querysets/#values) values()¶ values(*fields)¶ Returns a QuerySet that returns dictionaries, rather than model i
mysql 将指定列的浮点数转化为整数: update A set B = cast(B as decimal(10,0)) -- 或者 update A set B = round(B,0) 例如:update hdcloude01.t_a01_eltable set t_a01_eltable.BatteryDal = round(t_a01_eltable.BatteryDal, 0) where t_a01_eltable.`BatteryDal` is not null;
//DataTable以列分组 var result = from r in dt.AsEnumerable() group r by ), b = r.Field<) } into g select new { key = g.Key, count = g.Count() }; var s = result.ToList();