使用vb.net从访问数据库中删除所有记录强类型 [英] delete all records from access database using vb.net Strongly typed

查看:215
本文介绍了使用vb.net从访问数据库中删除所有记录强类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim ddrc As Int16 = (Me.Temp_QuotesDataGridView.RowCount - 1)

With (Me.Temp_QuotesDataGridView)
    For Xxx = ddrc To 0 Step -1
        .Rows.Remove(.Rows(Xxx))
    Next
End With
Me.Validate()
Me.Temp_QuotesBindingSource.EndEdit()
Me.Temp_QuotesTableAdapter.Update(Me.M_B_DATABASEDataSet)



该代码没有从数据库中删除它是错误的

它显示记录从datagridview消失但当我打开数据库时所有记录仍然是。

i我正在使用vb.net强类型访问数据库


whats wrong with that code that it doesnt really delete from the database
it shows the records are gone from the datagridview but when i open the database all the records are still.
i am using vb.net strongly typed access database

推荐答案

您从DataGridView中删除了行。您没有标记要删除的DataTable中的行。你不要在DGV上做这样的操作。您可以在将DGV绑定到的存储对象上执行此操作。
You removed the rows from the DataGridView. You did NOT tag the rows in the DataTable to be deleted. You dont do operations like this on the DGV. You do them on the storage object that you bound the DGV to.


这篇关于使用vb.net从访问数据库中删除所有记录强类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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