sqlmetal.exe 运行并生成输出,但如何查询我的数据库?
我已经针对我的数据库运行了 sqlmetal.exe。
SqlMetal.exe /server:server /database:dbname /code:mapping.cs
我已将其纳入我的解决方案中。所以我现在可以为每个数据库表创建一个对象。伟大的。我现在想使用ling来通过数据库查询。我可以假设 sqlmetal.exe 的输出没有处理任何连接等吗?如果这是正确的,我可以通过哪些方式使用 ling 查询我的数据库?
I have run sqlmetal.exe agaisnt my database.
SqlMetal.exe /server:server /database:dbname /code:mapping.cs
I have included this into my solution. So I can now create an object for each of the database tables. Great. I now wish to use ling to query by database. Can I presume that none of the connection etc is handled by the output of sqlmetal.exe. If this is correct what ways can I use ling to query my database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
生成的代码是否包含数据上下文(继承自 System.Data.Linq.DataContext 的类)?如果是这样,那么这可能就是您正在寻找的。像这样的东西:
Does the generated code include a Data Context (a class which inherits from
System.Data.Linq.DataContext
)? If so, then that's probably what you're looking for. Something like this: