dataGridView数据绑定

string str = "select * from Books"; OleDbDataAdapter da = new OleDbDataAdapter(str,con.GetConnection()); DataSet ds = new DataSet(); da.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView;
C# | 2007-08-21 19:28 | 阅读 1068 次 | 评论 0 条

Access数据连接

using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Windows.Forms;using System.Data.OleDb; namespace Bookshop{ class Connection { OleDbConnection con; public OleDbConnection GetConnection() { try { ...
C# | 2007-08-11 00:03 | 阅读 1371 次 | 评论 0 条

MDI用法

Printset prt;//要显示的窗体 private void toolStripMenuItem39_Click(object sender, EventArgs e) { if (prt == null || prt.IsDisposed) { prt = new Printset(); prt.MdiParent = this;//父窗体为当前窗体 prt.Show(); } ...
C# | 2007-08-11 00:02 | 阅读 1016 次 | 评论 0 条

判断是否退出窗体

private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("是否退出本系统?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { e.Cancel = false; } else { e.Cancel = true...
C# | 2007-08-11 00:01 | 阅读 1018 次 | 评论 0 条
最新评论