如何在anaspx文件中引用DBML文件?

发布于 2024-10-01 11:11:09 字数 109 浏览 1 评论 0原文

我有一个 ascx 文件和 dbml linq 文件。我需要在 ascx 文件中编写 C# 脚本,为此我需要使用 .dbml 文件。我不知道如何在我的 ascx 文件中引用它。

提前致谢。

I have a ascx file and dbml linq file. i need to write c# script inside the ascx file, for that i need to use .dbml file. I dnt know how to reference it in my ascx file.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡忘如思 2024-10-08 11:11:09
using System.Data.Linq.DataContext;
using System.Data.Linq.DataContext;
伤感在游骋 2024-10-08 11:11:09

您实际上并不直接引用 DBML 文件,而是引用 DBML 文件生成的类。您需要使用 <%@ Import %> 指令、Imports (VB) 或 using (C#) 语句来引用DBML 文件的命名空间。

我建议阅读 ScottGu 的关于 LINQ 到 SQL

附注
在这个网站上“提前感谢”是不礼貌的。如果有人给了您正确的答案,请将他们的答案标记为正确以表示感谢。谢谢。

You don't actually reference the DBML file directly, you reference the classes generated by the DBML file. You need to use a <%@ Import %> directive, or a Imports (VB) or using (C#) statement to reference the namespace of the DBML file.

I recommend reading ScottGu's blog about LINQ to SQL.

PS
It's impolite to "thank in advance" on this site. If someone gives you the correct answer, thank them by marking their answer as correct. Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文