I have been working through a tutorial from a book on using Linq,
I have been happily working away when suddenly after creating a new page and adding a drop down, when clicking to configure data source, my datacontext object doesnt show up in the list after selecting linq.
Can anyone help, to be honest i am not sure where i actually setup the datacontext ("planetwroxdatacontext") its easy to get lost with these books.
I have managed to sort this by deleting the datacontext and re adding it.
However its only temporary as the next time i restart VWD i have to do it again, it doesnt seem very reliable and i must of had to do this about 40 times already.
Did you uncheck the option "Show only data components" when selecting data source? I don't think it will miss if you have set everything OK. But if you still can't get the problem resolved, please show us some screen snippets so that we can know it clearly.
Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
This linq stuff is starting to drive me mad now, this problem seems to be ok but for some reason yesterday afternoon i was hit with massed of error messages from the designer page as part of the context, i cannot fix any of them no matter how hard i try.
The funny thing is that this file is compiled automatically and i had not even touched the file before it screwed up.
At the moment my page will not run at all because of these messages, some of these are below:
Error 2 Value of type 'AttributeMappingSource' cannot be converted to 'System.Data.Linq.Mapping.MappingSource'.
Error 3 'GetTable' is not a member of 'PlanetWroxDataContext'. ('I have about 5 or six copies of this error').
Error 7 'AddressOf' expression cannot be converted to 'Object' because 'Object' is not a delegate type.
Error 9 'Remove' is not a member of 'EntitySet(Of Review)'.
Error 10 'Add' is not a member of 'EntitySet(Of Review)'.
I have honestly had enough of linq as it has completely screwed up my page and added hours of time to this project.
After the automatic code generation from DataContext, did you do some modification? Where did you call the GetTable method of the DataContext? I suggest you to firstly check the namespace of DataContext, and ensure it can be used correctly. Then, please
show us the detailed code written by yourself with DataContext.
Thanks.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
connersz
Member
153 Points
175 Posts
Problems with Linq Choose DataContext Object
Jul 12, 2010 11:05 AM|LINK
Hi All,
I have been working through a tutorial from a book on using Linq,
I have been happily working away when suddenly after creating a new page and adding a drop down, when clicking to configure data source, my datacontext object doesnt show up in the list after selecting linq.
Can anyone help, to be honest i am not sure where i actually setup the datacontext ("planetwroxdatacontext") its easy to get lost with these books.
PeteNet
All-Star
81342 Points
11398 Posts
Re: Problems with Linq Choose DataContext Object
Jul 12, 2010 04:25 PM|LINK
make sure you save the .dbml (or .edmx) file and compile the project.
Peter
connersz
Member
153 Points
175 Posts
Re: Problems with Linq Choose DataContext Object
Jul 14, 2010 01:20 PM|LINK
I have managed to sort this by deleting the datacontext and re adding it.
However its only temporary as the next time i restart VWD i have to do it again, it doesnt seem very reliable and i must of had to do this about 40 times already.
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: Problems with Linq Choose DataContext Object
Jul 15, 2010 01:46 AM|LINK
Hi connersz,
Did you uncheck the option "Show only data components" when selecting data source? I don't think it will miss if you have set everything OK. But if you still can't get the problem resolved, please show us some screen snippets so that we can know it clearly.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
connersz
Member
153 Points
175 Posts
Re: Problems with Linq Choose DataContext Object
Jul 15, 2010 08:46 AM|LINK
This linq stuff is starting to drive me mad now, this problem seems to be ok but for some reason yesterday afternoon i was hit with massed of error messages from the designer page as part of the context, i cannot fix any of them no matter how hard i try.
The funny thing is that this file is compiled automatically and i had not even touched the file before it screwed up.
At the moment my page will not run at all because of these messages, some of these are below:
Error 2 Value of type 'AttributeMappingSource' cannot be converted to 'System.Data.Linq.Mapping.MappingSource'.
Error 3 'GetTable' is not a member of 'PlanetWroxDataContext'. ('I have about 5 or six copies of this error').
Error 7 'AddressOf' expression cannot be converted to 'Object' because 'Object' is not a delegate type.
Error 9 'Remove' is not a member of 'EntitySet(Of Review)'.
Error 10 'Add' is not a member of 'EntitySet(Of Review)'.
I have honestly had enough of linq as it has completely screwed up my page and added hours of time to this project.
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: Problems with Linq Choose DataContext Object
Jul 16, 2010 02:16 AM|LINK
Hi connersz,
After the automatic code generation from DataContext, did you do some modification? Where did you call the GetTable method of the DataContext? I suggest you to firstly check the namespace of DataContext, and ensure it can be used correctly. Then, please show us the detailed code written by yourself with DataContext.
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework