VB.NET:从存储过程获取 DataGridView 进行填充
我刚刚接到一份 VB.NET 原型设计工作,而且我对 VB.NET 的经验不是很丰富。
我必须创建一个存储过程,它按顺序返回一个自引用表。 有一次,我完成了我想要获得一个 DataGridView 来显示结果。
以前,我的团队已经通过 VB.NET 的 GUI 设计器完成了很多这样的工作,因此不幸的是,我没有大量代码可以描述。
我试图遵循他们的模式,我将在这里简要描述:
我有一个 DataGridView,其 DataSource 属性指向 BindingSource。 BindingSource 指向一个DataSet。 该数据集的编辑器调用一个 TableAdapter,它从存储过程中获取数据。
我预览了 TableAdapter 的数据。 数据就在那里。 在 frmMain 加载时,运行 TableAdapter 的 Fill 命令。
什么也没看到。 我的直觉是,这个过程太复杂了,不可能是正确的。 或者可能不是。 在我决定打扰你们这些好人之前,我做了很多谷歌搜索。
I was just handed a VB.NET prototyping effort, and I'm not very experienced with VB.NET.
I had to create a stored procedure which returns a self-referential table in order. Once, I completed that I wanted to get a DataGridView to show the results.
Previously, my team has been doing a lot of this via the GUI designer of VB.NET so I don't have a ton of code to describe, unfortunately.
I was trying to follow their pattern which I will briefly describe here:
I have a DataGridView whose DataSource property points to a BindingSource. The BindingSource points to a DataSet. The editor for that DataSet calls a TableAdapter which gets the data from the stored procedure.
I previewed the data for the TableAdapter. The data is there. On frmMain's load the TableAdapter's Fill command is run.
Not seeing anything. And my hunch is that this is way too complex a process to be correct. Or maybe not. I did a lot of Google searches before I decided to bother you fine folks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许你做了类似的事情:(
这将向你显示一个空网格)
尝试
Maby you did something like:
(That will show you an empty grid)
Try