使用DataGridView的数据库 [英] Databases with DataGridView

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

问题描述

我正在创建一个银行客户的详细信息应用程序。信息存储在Microsoft Access文件中,我能够通过文本框和DataGridView使信息显示在我的VB应用程序中,但我无法保存,编辑或删除记录。有没有人有任何想法。下面是我的代码。

展开 | 选择 | Wrap | 行号

解决方案

这有很多问题码。建议调试并尝试先解决一些问题。谢谢。


它实际上只在运行时抛出一个错误,即第84行。错误是''对象引用未设置为对象的实例。'

问题是由于urg数据集对象objDS

在Add,Delete或Edit事件ur数据集时为null。所以你必须在会话中存储数据集,并在每个事件中从会话中获取它,然后进行你想要的操作。


I am creating a bank customer''s details application. The information is stored on a Microsoft Access file and I was able to make the information appear on my VB application through text boxes and a DataGridView but I am not able to save,edit or delete records. Does anybody have any ideas. Below is my code.

Expand|Select|Wrap|Line Numbers

解决方案

There are a number of problems with this code. Suggest debugging and trying to solve some first. Thanks.


It actually only throws up one error in run time and that is line 84. The error is ''Object reference not set to an instance of an object.''


Problem is due to ur dataset object objDS
At time of Add, Delete or Edit event u r dataset is null. so u must store dataset in session and on each event take it from session and then do operation u want.


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

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