Biztalk 2010 ESB itinerary custom Resolver and entity framwork connection - biztalk

I have created a custom resolver and get data from database using Data access layer using entity framework 4.0, the entity framework connection string kept in BTSNtsvc.exe.config file
<add name="MadagascarDbEntities"
connectionString="metadata=res://*MadDb.csdl|res://*/MadDb.ssdl|res://*/MadDb.msl;provider=System.Data.SqlClient;provider
connection string="data source=ttttt;initial catalog=MadagascarDb;persist security info=True;user id=eeeee;password=xxxxxx;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
However I'm getting following error ...
The invoked member is not supported in a dynamic assembly.
Source: Microsoft.Practices.ESB.Resolver.ResolverMgr
Method: System.Collections.Generic.Dictionary`2[System.String,System.String] Resolve(Microsoft.Practices.ESB.Resolver.ResolverInfo, Microsoft.BizTalk.Message.Interop.IBaseMessage, Microsoft.BizTalk.Component.Interop.IPipelineContext)
Error Source: mscorlib
Error TargetSite: System.IO.Stream GetManifestResourceStream(System.String)
Error StackTrace: at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceStream(String name)
any clues?
thanks for any help

Related

Entity Framework and ApplicationIntent=READONLY

I am using Entity Framework v6.4.4 database first in an ASP.NET Framework v4.6.2 application. This is my connection string entry in web.config:
<add name="MyApplicationEntities" connectionString="metadata=res://*/Models.MyApplication.csdl|res://*/Models.MyApplication.ssdl|res://*/Models.MyApplication.msl;provider=System.Data.SqlClient;provider connection string="data source=*****;MultiSubnetFailover=True;initial catalog=****;persist security info=True;ApplicationIntent=READONLY;user id=****;password=****;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
If ApplicationIntent=READONLY is in the connection string then I get an exception when I try to access the database:
The underlying provider failed on Open --> The wait operation timed out.
otherwise everything is fine.
I have seen this answer - https://stackoverflow.com/a/21241299/1471850 - but this doesn't help. Does anyone know what the issue might be?

Unable to find the requested .Net Framework Data Provider. It may not be installed

I am having problem in running my ASP.Net MVC project which is an admin project. It connects with a sql server database to fetch record. When I try to build and run, I am welcomed with this error: "Unable to find requested .Net Framework Data Provider. It may not be installed".
Here is the link to this error.
I have tried many solutions available on stackoverflow but none of them worked for me that's why I am posting this question here again. I tried changing the Target Framework version in Properties of project to all the available versions but all in vain. Here is the screenshot of my Global.asax.cs file which is causing this exception.
Below is the connection string of my project:
<add name="AlkhaleejEntities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=Alkhaleej;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/>
Connection string provided above indicates EF connection provider being used:
connectionString="metadata=res:///Models.Model1.csdl|res:///Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=Alkhaleej;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"
Note that SimpleMembershipProvider can't use EF provider connection string (see this post) due to usage of SqlClient provider instead of EntityClient, hence it requires SQL Server connection string to interact with database.
Try open Server Explorer => Data Connections => right click your server connection, select Properties => add provided SQL Server connection string something like this one (leave EF connection string part as is, just add SqlClient provider connection string):
<add name="DefaultConnection" connectionString="Data Source=.;Initial Catalog=Alkhaleej;Integrated Security=True" providerName="System.Data.SqlClient" />
Then, change connectionStringName parameter on WebSecurity.InitializeDatabaseConnection method inside SimpleMembershipInitializer class to SQL Server connection string name as given below:
public class SimpleMembershipInitializer
{
public SimpleMembershipInitializer()
{
// other code part
if (!WebSecurity.Initialized)
{
WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "Email", autoCreateTables: true);
}
}
}
NB: The ideal setup for EF projects should include at least one SqlClient connection string and one EntityClient connection string, which may serve different providers with same target database.
Similar issues:
SimpleMembershipInitializer won't initialize
Unable to find the requested .Net Framework Data Provider. (SqlClient)
Can SimpleMembership and Entity Framework share a connection string?

Connection string error using membership provider from WCF service

The target is: I need a wcf method which will create user in the database.
I am using membership provider. and My client is SmartPhone/mobile device.
I wrote a method which will create user BUT when I test the method I get the following error.
error:
An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString
And I get this error in the following line:
Membership.CreateUser(name, password,email,"question","answer",true,out createStatus);
I am using the same connectionString that I use to read data from the database.
My connection string is:
<add name="MajangoEntities" connectionString="metadata=res://*/EntityModel.MajangoEntityModel.csdl|res://*/EntityModel.MajangoEntityModel.ssdl|res://*/EntityModel.MajangoEntityModel.msl;provider=System.Data.SqlClient;provider connection string="data source=tcp:sql2k298.discountasp.net;initial catalog=SQL2008R2_835021_myddb;user id=SQL2008R2_835021_mydb_user;password=mypassword;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
Can anybody help me with some ideas??
That connection string includes some Entity Framework specific data. Try instead just the "provider connection string" embedded within it:
<add name="MajangoEntities" connectionString="data source=tcp:sql2k298.discountasp.net;initial catalog=SQL2008R2_835021_myddb;user id=SQL2008R2_835021_mydb_user;password=mypassword;multipleactiveresultsets=True;App=EntityFramework">
The rest of the data in there (the metadata, etc.) is just confusing SQL Server.

How to use SimpleMembership in MVC with Entity Framework

I want to use SimpleMembership in an MVC 3 website, but I'm getting the following error:
System.ArgumentException was unhandled by user code. Unable to find the requested .Net Framework Data Provider. It may not be installed.
I'm using a SQL Server database, through Entity Framework. Here is my connection string:
<add name="Database1Entities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Database1.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I already use EF in other parts of the application, so this connection string is correct and I have connection to the database. Can you please help?
I had the exact same problem. The work around I found was to take out that "metadata=..." part of the connection string and put in just the connection string information. My look similar to this:
<add name="Membership" connectionString="Data Source=serverName;Database=databaseName;User ID=userId;Password=aPassword;Trusted_Connection=False;Encrypt=True;" providerName="System.Data.SqlClient" />
Hope that helps!

ASP.NET MVC : Using the same database for Entity Framework and ASP.NET Membership

Im trying to user ASP.NET MVC3 with Entity Framework and ASP.NET Membership for authentication. I've set up an existing database as my application services database for membership.
When i create the entity data model through the wizard it adds the following connection string to my web.config.
<add name="DBEntities" connectionString="metadata=res://*/Models.DB.csdl|res://*/Models.DB.ssdl|res://*/Models.DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=PM\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
I'm a noob so i don't really understand why but i tried using the same connection string for my membership provider and failed (probably because of this: providerName="System.Data.EntityClient" ?).
So i added a separate connection string to the same database and used it for the membership provider.
<add name="ApplicationServices" connectionString="Data Source=PM\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True" providerName="System.Data.SqlClient"/>
It works fine when i use ASP.NET configuration to add user and etc. But when i run the application and try to do something like validating a user i get an error;
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
I made a guess this has something to do with my connection strings. I'm hoping some of you experts can help. Cheers.
Have you tried restarting the server : A transport-level error has occurred when receiving results from the server ?
Not a solution or an answer, just a pointer to a similar issue..

Resources