如何使用按钮打开访问数据库 [英] How to use a button to open a access database
本文介绍了如何使用按钮打开访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个填充到Access DataBase的Winform。我有一个显示信息的Datagrid。有没有办法在点击时添加一个按钮,它打开DataGrid或Access数据库,而不是我在主窗体上显示它?
我试过的:
在互联网上研究多个小时
I have a Winform that populates to a Access DataBase. I have a Datagrid that shows the information. Is there a way to add a button when clicked it opens the DataGrid or Access DataBase instead of me showing it on the main form?
What I have tried:
Research on the internet for many hours
推荐答案
查看此示例如何使用按钮: [按钮]
您也可以使用DataGridView打开表单,而不是显示消息框,如下所示:
See this example on how to use a Button: [Button]
Instead of displaying a Messagebox you can also open your Form with the DataGridView, like this:
private void button1_Click(object sender, System.EventArgs e)
{
Form form2 = new Form2();
form2.Show();
}
像魅力一样......谢谢
Worked like a charm...thank you
这篇关于如何使用按钮打开访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文