摘要: 从excel表中读取出数据放入一个dtTable中,在放入到数据库中//导入读取数据,获取数据信息 private void btnImport_Click(object sender, EventArgs e) { string filepath = openFileDialog.FileName; if (filepath == null || filepath.Equals(0)) return; try { us... 阅读全文
posted @ 2013-04-10 16:03 lichen辰 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 删除gridview里的一行或者多行内容: //删除 private void btnDelete_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection rows = this.dataGridView1.SelectedRows; foreach (DataGridViewRow row in rows) this.dataGridView1.Rows.Remove(row); }进入页面:选... 阅读全文
posted @ 2013-04-10 13:22 lichen辰 阅读(105) 评论(0) 推荐(0) 编辑
摘要: //添加按钮 private void btnAdd_Click(object sender, EventArgs e) { DialogResult result = openFileDialog.ShowDialog(); if (DialogResult.OK == result) { string filepath = openFileDialog.FileName;//文件所在路径 FileInfo fileInfo = new F... 阅读全文
posted @ 2013-04-10 13:13 lichen辰 阅读(100) 评论(0) 推荐(0) 编辑