szkut szkut - 6 days ago 6
ASP.NET (C#) Question

Linq to Sql datacontext is not defined

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.DataContext
is 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

Answer

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

Comments