如何在c#按钮上删除excel中的一行 [英] how to delete a row from excel on button click in c#

查看:376
本文介绍了如何在c#按钮上删除excel中的一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据textbox1中提供的产品ID,在按钮点击时从Excel工作表中删除一行。使用该product_id它应该从excel表中删除整行并在datagridview中显示更新的数据????

How can i delete a row from excel sheet on button click based on product id provided in textbox1. Using that product_id it should delete the whole row from excel sheet & display updated data in datagridview ????

推荐答案

将excel数据重新转换为数据表然后删除所需的数据数据表中的行

并写回excel文件。(带有记录的当前数据表)
Reade the excel data into a datatable then delete your required row from the datatable
and write back to excel file.(the current datatable with records)


这篇关于如何在c#按钮上删除excel中的一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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