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;
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 { ...
Printset prt;//要显示的窗体 private void toolStripMenuItem39_Click(object sender, EventArgs e) { if (prt == null || prt.IsDisposed) { prt = new Printset(); prt.MdiParent = this;//父窗体为当前窗体 prt.Show(); } ...
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("是否退出本系统?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { e.Cancel = false; } else { e.Cancel = true...