Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 16, 2010 02:16 AM by Wencui Qian - MSFT
Jul 12, 2010 11:05 AM|LINK
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.
Jul 12, 2010 04:25 PM|LINK
make sure you save the .dbml (or .edmx) file and compile the project.
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.
Jul 15, 2010 01:46 AM|LINK
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.
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.
Jul 16, 2010 02:16 AM|LINK
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.