从gridview中删除行而不篡改数据库 [英] Deleting rows from gridview without tampering the databse

查看:112
本文介绍了从gridview中删除行而不篡改数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从gridview中删除行(使用删除命令按钮)而不删除数据库中的数据有哪些方法?请提供一些示例..:(

What are the approaches to delete rows from gridview (with delete comand button)without deleting the data from database? please provide some examples.. :(

推荐答案

一个与另一个无关。除非你明确告诉某些方法用更改来更新数据库,你可以删除DataGridView中的每一条记录,数据库都不会发生任何事情。
One has nothing to do with the other. Unless you specifically tell some method to update the database with the changes, you could delete every single record in the DataGridView and nothing will happen to the database.


hiiii,



试试这个



hiiii,

try this one

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
    dt.Rows.RemoveAt(e.RowIndex);
    GridView1.DataSource = dt;
    GridView1.DataBind();
}


这篇关于从gridview中删除行而不篡改数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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