Add function import functionality seems to be broken in EF6 - visual-studio-2010

I am trying to import a function into my entity model. I am running VS 2012, using Entity Framework 6 with the according tools and yet no stored procedures or function names appear under the relevant drop down in the "Add Function Import" dialog.
Does anyone else have this issue? If so, does anyone have a solution?

Check your database user permissions, I think it needs ddladmin, at least that fixed it for me.

Related

Visual Studios .NET 4 - adding Oracle Database as Data Source - Warnings about OracleDataAdatper deprecated

When I add an Oracle Database as a Data Source to my project, the automatically generated code in the TableAdapter section is uses System.Data.OracleDataAdapter which is obsolete.
Following the documentation explains that you should use the third party Oracle software (ODAC). Given that the code is autogenerated, I am confused.
Am I missing something here?
Possible Solutions:
I could use .NET 3.5 for my Data Access Layer
Ignore the warnings
Manually Create Table Adapters
Something I am missing?
The solution is to use Oracle Developer Tools for Visual Studios. Add the Data Source in the same way as before (except the form now looks different as a result of the newly installed add on).

Telerik Data Access generate classes automatically

Until the recent release I was happily using Telerik Data Access in a database first way:
Created the database schema in external DB designer
Generated a fluent model in Visual Studio
Whenever I did a database change I either re-ran the generation or updated models via visual designer depending on the magnitude of the change
After the last release the templates I used for the generation are gone (as is the visual designer) and any attempt at Googling the solution takes me to a Telerik documentation page saying the info is deprecated.
I'm working with large existing databases (100+ tables) and there's no way I'm coding the models by hand.
What are the current options for auto generating the models?
I got a reply on Telerik forums. Simply said there's nothing I can do now and have to wait til/if they develop a solution. For all that are interested, please vote on the feature request.
Here's the reply:
Thank you for your feedback.
We have already created a new feature request (http://feedback.telerik.com/Project/114/Feedback/Details/163155-generation-of-fluent-models-with-data-access-q2-2015-and-higher) to create a code generating tool to create your fluent models based on your database schema. You are welcome to cast your support vote for the item.
I cannot give you any time frame when we will be able to ship such tool, but I will make sure to notify you as soon as we have a public release.
Regards,
Viktor Zhivkov
Telerik
The feature is still not available. But maybe this is an alternative to being stuck with VisualStudio 2013.
Owners of VisualStudio Enterprise have another option. They can modify the code generation templates and generate the fluent metadata and context code from an UML class diagram.
I invested in checking the MSDN documentation and created a VS extension which I open-sourced.
Please check https://github.com/bdongus/UMLExtensions for details. Feel free contribute.

Namespace cannot be found when rebuilding entity framework

I've rebuilt my entity framework in an MVC 3 project. This was working before I did this. Now though, I get the error:
The type or namespace name 'myEntities' could not be found (are you missing a using directive or an assembly reference?)
everywhere in my code where it references the Entity Framework. This was working before the rebuild so it follows that it has to be that. I've checked that the name of the connection in my web.config and have deleted and re-installed the entity framework but it's not being referenced.
Any ideas how to fix this error?
Today I faced the same issue and waste my entire day.
Finally I start reading errors line by line and found the exact error.
On two tables I removed relationship and that was all the cause of problem.
Even I added all the relationship and update model but still not working.
Removed those tables from emdx on which I removed and re-added relationship
rebuild and found everything gone except the removed tables
Added those tables and done
Lo and behold, it was simple. I named the connection string to a different name than the object name I call in my code!
I solved this problem by deleting all tables from Entity .edmx then right click and select update model from database and select all tables you want ,Next rebuild the project.
Why don't you check out this other SO post which has a very similar problem to yours. It gives a few different suggestions to fix your problem and hopefully one of them will work out for you! Cheers!
The referenced component 'EntityFramework' could not be found.
Today I updated one table column. Had to delete and then re-add the table and any tables with a relationship to it to get it to generate properly again.
you can make another connection string...
or
try mentioning Using system.data.entity,
or
intall entity framework using manage Nuget Packages
or
select project name-> click tools(from menu items)-> package manager(nuget)->terminal
paste and run=> install-package EntityFramework
or
Find entity name in model browser as for example(green name in red circle)

Downgrade / import XPO from 2009 to 4.0

Is there any tool / automatism to import an XPO, exported from AX 2009 to AX 4.0?
The straight way does not work, since properties listed in XPO differ, e.g. I get the exception that import has been cancelled because of "...PROPERTY found, DATASOURCE expected..."
Only information I found is the one linked
Any tipps are appreciated!
#edit:
After testing and trying - import partitially works.
What I'm missing are:
indices on tables
fieldGroups on tables
deleteActions on tables
relations on tables
You can't out of the box "downgrade" projects. You can migrate code to the next version but you can't go backwards.
With that said, if you can import some kinds of objects is by accident, but it is not a supported feature. But you can export objects one by one (or type by type) and then try to import the ones that don't fail and replicate manually the ones that throw errors.
Another "solution" is try to modify the XPO manually based on the received errors during the previous step, but this is totally undocumented and will be doomed to try-and-error.

How do I use LinqPad for updates with CRM 2011

I am working with linqpad and crm 2011, cloud version, and C# snippets. Simple select queries work as advertised. Nonetheless for linqpad to be of any real use I need to get it to do updates and inserts as well and have not been able to find sample code which works or come up with any real information. Several kinds of things which show up in sample code I see around the net are missing. in particular, TestDataContext appears to be part of one or more assemblies which get loaded with linq-sql projects in Visual Studio, but is not in evidence on linqpad. SubmitChanges is not there, and it is not clear what I'd have to do to get at it or to instantiate a new DataContext object and try to use its submitchanges method.
Any usable information would be appreciated.
Well I don't know the CRM 2011 LINQ implementation. Does LINQPad have direct support for that?
Anyway, you basically can run any C# code in LINQPad. Here's a step-by-step guide how to run the needed code:
You need to add the required framework assemblies (maybe take a look at your Visual Studio project). To achieve this, go to the ‘Query’->’Advanced Query Properties’. On the dialog, click on ‘Add…’, then on ‘Browse…’. Browse to the assemblies. Add the required assemblies. Keep the ‘Advanced Query Properties’-dialog open for the next step. Optinally add your own assemblies when you use types from it.
In the ‘Advanced Query Properties’-dialog go the tab ‘Additional Namespace Imports’. Add there the namespaces you need. Expecially the LINQ-namespaces of your LINQ-provider.
Click on ‘Set as default for new queries’ so that you don’t need to repeat the three steps above next time. Then we’re done.
Now you can use the LINQ-provider in LINQ-Pad. Use the 'C#-Statements'-language. Use the .Dump-method to view query results.
Now with that steps you can use any API in LINQPad. With that you can do loops and use the regular API to update objects.
Here's what worked for me in Linqpad for CRM.
Remember that the context is implied in Linqpad.
Create your new entity and load its data, then:
AddObject(entityName);
SaveChanges();

Resources