帮助datagridview [英] Help with datagridview

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

问题描述

大家好,

首先为我抱歉English

我在同一主题下发布了2或3倍大的文章,但找不到任何我能处理的答案.

我有一个可访问的数据库,我想创建一些datagridview,但是都一样.
我的问题是在我的表中没有自动递增编号,在任何添加中我都必须自己找到密钥(max(key)),并且在最后一个字段中我必须写入系统日期.

我已经创建了一个datagridview,但是当我尝试添加新记录时,我不知道如何在我的最后一个字段中插入密钥的最大值和系统日期,结果是出现错误.

请帮助我....
我想要在任何添加新记录中找到在插入完成之前在新记录中插入键和系统日期的方法.

因为我是VB新手,所以我想更具体些.

如果有人能够用VB编写一些核心,那就太好了.

我的表是Movement_roller_h,字段是
movement_roller_h_doc-必需的密钥是
movement_roller_h_date-所需日期/时间是
movement_roller_h_typekkin_id-必需的字符串是
movement_roller_h_text-必需的字符串是
movement_roller_h_date_create-所需日期/时间是

非常感谢您抽出宝贵的时间.

Hi to all,

First of all sorry for me English

I have post 2 or 3 times older with the same subject but i don''t find any answer that i can handle.

I have a database in access and i want to create some datagridview but is all the same.
My problem is in my tables i don’t have an auto increment number and in any add i have to found the key myself (max(key)) and in my last field i have to write the system date.

I have create a datagridview but when i try to add a new record i don’t knew how to insert the max of the key and the system date in my last field and the result is to get an error.

PLEASE help me....
I want in any add new record to find a way to insert in the new record the key and the system date before the insert finish.

Because i am new in VB i would like to be more specific.

If someone is able to write some core in VB this will be great.

My table is movement_roller_h and the field is
movement_roller_h_doc - key required yes
movement_roller_h_date - date/time required yes
movement_roller_h_typekkin_id - string required yes
movement_roller_h_text - string required yes
movement_roller_h_date_create - date/time required yes

Thanks a lot for your time.

推荐答案

您需要处理
You need to handle the DefaultValuesNeeded.aspx[^] event.

In the handler set the
e.Row.Cells["nameOfYourKeyCell"].Value = 'Do your Max(key) thing here
e.Row.Cells["nameOfYourDateCell"].Value = DateTime.Now.ToString()


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

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