需要DataGirdView的帮助 [英] Need Help with DataGirdView

查看:118
本文介绍了需要DataGirdView的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您提前的时间,我需要帮助,我想在Windows窗体中创建一个 DataGridView ,并且在此网格中我想输入数据,何时我点击输入它应该保存该数据到数据库并创建另一行,我试图找到一个很好的教程,但没有成功。如果有任何好的例子,请告诉我

解决方案

  void  dataGridView1_PreviewKeyDown( object  sender,PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
// 将交易处理到DB
}
}


google results [ ^ ]

Thank you for your time in advance, I need help, I want to create a DataGridView in Windows form, and in this grid I want to enter data and when I hit enter it should save that data to database and create another line, I tried to find a good tutorial on it but didn’t succeeded. if there is any good example please let me know

解决方案

void dataGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
    {
        // Handle your transaction to DB here
    }     
}


google results[^]


这篇关于需要DataGirdView的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆