Linq到Sql的datacontext没有定义(Linq to Sql datacontext is not defined)

编程入门 行业动态 更新时间:2024-10-23 02:46:38
Linq到Sql的datacontext没有定义(Linq to Sql datacontext is not defined)

在不久的将来,我被迫在项目的Visual Basic Web表单上工作。 我有点困惑。

第一种情况: c#webform:当我在解决方案窗口中添加.aspx文件时,我可以扩展文件,并有.aspx.cs和.aspx.designer.cs Vb.net webform:当我在解决方案中添加.aspx文件窗口我不能扩展文件。 我只能按下鼠标右键并选择查看代码( F7 )。 这些文件在哪里? 解决方案中有文件的位置? 如果他们看不见如何做到这一点是可见的? thx法比奥答案

.dbml 情况: c#webform:当我在解决方案窗口中添加.dbml (linq to sql)文件时,我可以扩展文件,并且存在.dbml.layout和.aspx.designer.cs当我想在代码隐藏中引用datacontext时IDE建议filenameDataContext 。 当我去.aspx.designer.cs有一个巨大的生成类文件。 Vb.net webform:当我在解决方案窗口中添加.dbml (linq to sql)文件时,我无法扩展文件当我想要在代码隐藏IDE中引用datacontext时,建议使用filenameDataContext 。 当我按下鼠标右键并选择视图代码( F7 )时 - IDE仅显示:部分公共类WynikiDataContext结束类如何生成设计器文件并在哪里可以找到它?

在fabio的回答后,我看到designer.vs。 我有一个错误 - System.Data.Linq.DataContext未定义

Warning BC40056 Namespace or type specified in the Imports 'System.Data.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

我该如何解决它?

我想要更具体。 这个问题让我疯狂。 我英文不好,所以我决定做一个小节目:

Linq to sql , 我缺少单词 ,Dim db As New HelpMeDataContext - 类型'HelpMeDataContext'未定义

什么即时做错了? 当我做同样的事情,用c#webform工作

In the near future I am forced to work on the project visual basic web forms. I am a little confused.

1st situation: c# webform: When I add the .aspx file in the solution window I can extend file and there are .aspx.cs and .aspx.designer.cs Vb.net webform: When I add the .aspx file in the solution window I cant extend file. I can only press right mouse and select view code (F7). Where are those files? Where there are files in the solution? if they are invisible how to do that were visible? thx for Fabio'a answer

2nd situation: c# webform: When I add the .dbml (linq to sql) file in the solution window I can extend file and there are .dbml.layout and .aspx.designer.cs When i want to refer a datacontext in codebehind the IDE suggest filenameDataContext. When i go to .aspx.designer.cs there is a huge generate class file. Vb.net webform: When I add the .dbml (linq to sql) file in the solution window I cant extend file When i want to refer a datacontext in codebehind the IDE dosent suggest filenameDataContext. When I press right mouse and select view code (F7) - IDE shows only: Partial Public Class WynikiDataContext End Class How to generate a designer file and where i can find it?

After fabio's answer i see designer.vs. I have an error - System.Data.Linq.DataContextis not defined.`

Warning BC40056 Namespace or type specified in the Imports 'System.Data.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

How can I fix it?

I want to be more specific. This issue is driving me crazy. I'm not good in English so I decided to do a small show:

Linq to sql, I lack words, Dim db As New HelpMeDataContext - Type 'HelpMeDataContext' is not defined

What im doing wrong? When i do the same thing wiht c# webform its working

最满意答案

c#webforms我在App_Code文件夹中添加dbml - 每个工作在vba webforms我在App_Code文件夹中添加dbml - 并出错(Type 'HelpMeDataContext' is not defined bla bla bla)当我添加DBF DIFRENT文件夹其工作..我没有明白,但它的工作原理

In c# webforms i added dbml in App_Code folder - every is working In vba webforms i added dbml in App_Code folder - and go an error (Type 'HelpMeDataContext' is not defined bla bla bla) When i addned dbml in DIFRENT folder its working... i dont get it but it works

更多推荐

本文发布于:2023-04-28 04:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1330280.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:定义   Sql   Linq   defined   datacontext

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!