GridView编辑,更新,删除 [英] GridView Edit,Update,Delete

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

问题描述

你好

我还有另一个问题,我想尝试在gridview上进行编辑和删除
由于我正在使用向导+存储过程,该怎么办?第二次,如果我要删除另一个表中的外键数据,该如何处理呢?

问候

解决方案

我想试着抓住gridview编辑和删除
.....我该怎么做

您在问如何放置try-catch?只需将其放在涉及更新或删除数据库中数据的代码行中即可.捕获错误,将其记录并显示友好消息!

如果我要删除另一个表中的外键数据,该如何处理
您需要执行级联删除".首先删除引用的关键项,然后再删除另一个.如果这限制了您并且是有效的限制,请提出错误并采取相应的措施.在网络表单上,请告诉我如何显示错误消息

问候


hello

i have another problem that is i want to put try catch on gridview edit and delete
since i m using wizard+store procedure how can i do that?second if i m deleting a data which is foreign key in another table how can handle this?

regards

解决方案

i want to put try catch on gridview edit and delete
..... how can i do that

You are asking how to put a Try-Catch? Just put it across the lines of code that deal with updating or deleting the data from DB. Catch the error, log it and display friendly message!

if i m deleting a data which is foreign key in another table how can handle this
You need to do ''cascading delete''. First delete the referenced key item and then the other one. If that restricts you and is a valid restriction, raise the error and act accordingly.


thnx for ur assistance i have put try catch but the problem now i m facing is that it cant display error message on web form so kindly tell me how can i display the error message

Regards


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

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