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