如何使用 VB.NET 将 SQL 查询的结果连接到导航栏?
我有一个关于在 Visual Basic 中使用数据库的基本问题。 我正在使用 OleDb 连接。我拖放了编辑框 从 DataDource 视图。这会自动放置表格导航- 表格上的栏。当我运行它时,效果很好。 但是我希望能够使用 SQL 语句在表中进行搜索。 如何将 SQL 查询的结果连接到导航栏,以便 编辑框自动获取记录的值,而无需 手动分配每个文本框?
非常感谢。
I have a basic question about using a database with Visual Basic.
I'm using a OleDb connection. I have dragged and dropped editboxes
from the DataDource view. This automatically places the table navigation-
bar on the form. When I run it this works fine.
However I want to be able to search within the table, with an SQL statement.
How can I connect the results from the SQL query to the navigation bar,such that
the editboxes automatically take the values of the record without having to
assign every textbox manually?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个小片段似乎有效,尽管您必须为表指定排序列,并且如果您想按多个字段排序,则在 Find 调用中传递与您正在搜索的值相对应的 Object() 类型的数组for (按照排序值的顺序。请告诉我它是否适合您或者您是否有任何其他问题。
这是一个包含多个排序列的示例
This little snippet seems to work, although you have to specify the Sort columns for your table, and if you want to sort by multiple fields then on the Find call you pass an array of Object() types that correspond to the values you are searching for (in the order of the Sort values. Let me know if it works for you or if you have any other questions about it.
Here is an example with multiple sort columns