I am new to LINQ but I would liek to start using it my web apps. I am trying to configure the linqdatasource but it asks for a datacontext object. Has anyone found any good tutorials for creating linqdatasources? OR can someone help me get started in
creating the datacontext object so I can use it in the linqdatasource. Thanks in advance!
I have created the dbml file inside of the project. I dragged a linqdatasource to my web page and am trying to configure it. But the CHoose Context Object dropdown doesn't contain my dbml file. Any ideas?
Ok...I got the linqdatasource created. Now when I view in browser I get the following error:
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'System.Data.Linq.Mapping.DatabaseAttribute' is not defined.
Source Error:
Line 23:
Line 24:
Line 25: <Global.System.Data.Linq.Mapping.DatabaseAttribute(Name:="MIS")> _ Line 26: Partial Public Class DataClasses1DataContext
Line 27: Inherits System.Data.Linq.DataContext
hmelton67
Member
12 Points
45 Posts
Configure LinqDataSource
Aug 07, 2012 08:39 PM|LINK
I am new to LINQ but I would liek to start using it my web apps. I am trying to configure the linqdatasource but it asks for a datacontext object. Has anyone found any good tutorials for creating linqdatasources? OR can someone help me get started in creating the datacontext object so I can use it in the linqdatasource. Thanks in advance!
bcanonica
Contributor
3082 Points
595 Posts
Re: Configure LinqDataSource
Aug 07, 2012 08:52 PM|LINK
Did you try building the project? When using the Linqdatasource you need to build the project to get he datacontext object visible in code.
Thanks,
BC
Blog Void Impossible
hmelton67
Member
12 Points
45 Posts
Re: Configure LinqDataSource
Aug 08, 2012 05:00 PM|LINK
I have created the dbml file inside of the project. I dragged a linqdatasource to my web page and am trying to configure it. But the CHoose Context Object dropdown doesn't contain my dbml file. Any ideas?
hmelton67
Member
12 Points
45 Posts
Re: Configure LinqDataSource
Aug 08, 2012 05:37 PM|LINK
Ok...I got the linqdatasource created. Now when I view in browser I get the following error:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'System.Data.Linq.Mapping.DatabaseAttribute' is not defined.
Source Error:
Line 23: Line 24: Line 25: <Global.System.Data.Linq.Mapping.DatabaseAttribute(Name:="MIS")> _ Line 26: Partial Public Class DataClasses1DataContext Line 27: Inherits System.Data.Linq.DataContextSource File: D:\projects\Workorders\Workorders\App_Code\DataClasses1.designer.vb Line: 25
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Configure LinqDataSource
Aug 09, 2012 01:10 AM|LINK
Please make sure that you've imported the:
1)system.Data.Linq.Mapping(as Namespace)
2)System.Data.Linq.dll
And then you can use "Database(……)" directly, "Attribute" can be ignored when using an attribute.
Reguards!