通过 ADO.net 和 C# 使用多个表
我刚刚开始使用 Visual Studio 和 C#,并试图解决我遇到的一个小问题。我有 Microsoft Access 背景,在数据库查询和表单方面有相当多的经验。
不过,我目前正在尝试使用 C#、ADO.net 和 Windows 窗体重新实现 access 数据库。 Visual Studio 可以很容易地创建基于一个表的表单,但我还没有找到如何基于多个表的数据创建表单。
有没有办法通过 Visual Studio 界面来做到这一点?如果没有,我该如何在代码中做到这一点?
任何信息将不胜感激,包括链接和教程,尽管我已经看过其中的一些并且不理解它们。我不知道如何从在 ASP 中显示数据(大多数教程似乎都使用)转换为在列表框中或在屏幕上顺序显示记录。
I've just started working with Visual Studio and C#, and am trying to solve a small problem I have. I come from a Microsoft Access background, and have quite a bit of experience with database queries and forms.
However, I am currently trying to re-implement an access database with C#, ADO.net, and Windows Forms. Visual Studio makes it easy to create a form based on one table, but I have not yet found out how to make a form based on data from multiple tables.
Is there a way to do this through the Visual Studio interface? If not, how do I do it in code?
Any information will be appreciated, including links and tutorials, although I have already looked at a few of these and not understood them. I can't work out how to convert from displaying data in ASP (which most tutorials seem to use) to displaying records in a list box, or sequentially on a screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 MSDN 中的主/详细教程:http:// /msdn.microsoft.com/en-us/library/aa984462(VS.71).aspx
希望这能让您朝着正确的方向前进。
PK
Check out this Master/Detail tutorial from MSDN: http://msdn.microsoft.com/en-us/library/aa984462(VS.71).aspx
Hopefully that will get you going in the right direction.
pk
您可能需要查看数据访问方法
希望这有帮助
you probably need to have look at data access methodologies
hope this helps
您还可以使用 dataview 类 http://msdn.microsoft.com/en -us/library/fdcwwhez.aspx 提供排序、附加过滤、派生列和其他一些功能,在某些方面与 Access 查询对象类似。
You can also use the dataview class http://msdn.microsoft.com/en-us/library/fdcwwhez.aspx which provides sorting, additional filtering, derived columns and several other bits of functionality that is similar to the Access query object in some respects.