在表单中搜索数据库时,搜索按钮在VB.NET中不起作用 [英] Search button is not working in VB.NET while searching a database in form

查看:49
本文介绍了在表单中搜索数据库时,搜索按钮在VB.NET中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

未处理的异常







朋友子搜索(table1 As Database2DataSet.Table1DataTable,text As String)

抛出新的NotImplementedException()

End Sub

结束班级



我尝试了什么:



Private Sub Searchbtn_Click(发送者作为对象,e作为EventArgs)处理Searchbtn。点击



Me.Table1TableAdapter.Search(Me.Database2DataSet.Table1,searchbox.Text)



结束Sub

unhandled exception



Friend Sub Search(table1 As Database2DataSet.Table1DataTable, text As String)
Throw New NotImplementedException()
End Sub
End Class

What I have tried:

Private Sub Searchbtn_Click(sender As Object, e As EventArgs) Handles Searchbtn.Click

Me.Table1TableAdapter.Search(Me.Database2DataSet.Table1, searchbox.Text)

End Sub

推荐答案

Sooooo你想提供你创建的搜索方法的实现,还是只想让它每次调用时都抛出一个NotImplemenetedException? />


您必须提供执行搜索操作的代码。 TableAdapter不会为您提供,因为它无法知道您要搜索或搜索的内容。
Sooooo did you want to provide an implementation of the Search method you created or did you just want it to throw a NotImplemenetedException every time you called it?

YOU have to provide the code to do your search operation. The TableAdapter isn't going to provide that for you because it has no way of knowing what you're trying to search or search for.


这篇关于在表单中搜索数据库时,搜索按钮在VB.NET中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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