如何将多个数据表链接到数据库中的SQLite表?
在使用 SQLite 的 C# 中,我的应用程序中有两个数据表。 DT1 和 DT2。使用DataAdaptor“DA”和数据集“DS”我必须将DT1链接到SQLite表“Analyzer”-。我希望能够将 DT2 绑定到与“Analyzer”相同的数据库中的另一个表。我该怎么做?
我使用相同的数据适配器还是 2 个不同的适配器?有没有办法在 Sqlite 中链接公共数据库下的表?我们使用相同的连接对象吗?如果有人能阐明这个问题,我将不胜感激?谢谢!
In C# using SQLite, I have two datatables in my application. DT1 and DT2. Using DataAdaptor "DA" and Dataset "DS" I have to linked DT1 to a SQLIte table "Analyzer"- . I wanna be able to tie DT2 to another table in the same database as "Analyzer". How do I do this?
Do I use the same data adaptor or 2 different adaptors? Is there even a way to link tables under a common database in Sqlite? Do we use the same connection object? I'd appreciate it if someone could shed some light on to this issue? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想使用 DataAdapter - 每个表一个,每个表一个 DataSet。不过,请分享连接。正如@ralf.w。 - 如果您不保存回数据库,则可以使用 UNION 并且仅拥有所有内容之一。
If you want to use DataAdapters - one per table, and one DataSet per table. Share the connection, though. As @ralf.w. - you can use UNION and only have one of everything if you're not saving back to the DB.