Membership Provider and Entities

Membership Provider and Entities

Postby AryaStark » Fri 17 Oct 2014 09:47

Hello

I'm currently testing the trial version for my company to see if it's worth purchasing. I'm developing a website using Membership Provider from Devart and it's working just fine. But at the same time I need to access the same tables via Entity Framework (again, the Devart option) and these two seem to be incompatible. I have two different projects, one that uses the Membership Provider and another one that uses the Entities. Separately they work fine, but once I put them together, just adding the entities connection string to the website that uses the membership provider, everything stops working.

Initializing the SimpleMembershipInitializer, on the line:

if (!context.Database.Exists())

it goes straight to catch and it shows the next exception:

the nclob type is not qualified with a namespace or alias. Only primitive types can be used without qualification.

My Web.config is like this:

<connectionStrings>
<add name="DefaultConnection" connectionString="User Id=***;Password=***;Data Source=TEST" providerName="Devart.Data.Oracle" />
<add name="EntitiesConnectionString" connectionString="metadata=res://*/MPModel.csdl|res://*/MPModel.ssdl|res://*/MPModel.msl;provider=Devart.Data.Oracle;provider connection string=&quot;User Id=***;Password=***;Server=TEST;Home=oraclient11g_home2;Persist Security Info=True&quot;"
providerName="System.Data.EntityClient" /> --> This is the conflictive one, one I add this line, the whole website stops working
</connectionStrings>

Take into account that both connection strings connect exactly to the same database, so User Id, Password and Data Source are exactly the same for both strings.

Any help with this?

Thanks

Arya Stark
AryaStark
 
Posts: 4
Joined: Fri 17 Oct 2014 09:39

Re: Membership Provider and Entities

Postby Shalex » Fri 17 Oct 2014 13:22

Please add the ";CodeFirstOptions.ColumnTypeCasingConventionCompatibility=False" entry to the value of the ProviderManifestToken property of your model.
As an alternative, you can specify this setting in the code or in app.config: http://forums.devart.com/viewtopic.php?f=1&t=29427.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44

Re: Membership Provider and Entities

Postby AryaStark » Mon 20 Oct 2014 15:24

Hello

I have added the CodeFirstOptions:

<Schema Namespace="MPModel.Store" Alias="Self" Provider="Devart.Data.Oracle" ProviderManifestToken="Ora11g;CodeFirstOptions.ColumnTypeCasingConventionCompatibility=False;" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:devart="http://devart.com/schemas/edml/StorageSchemaExtensions/1.0" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

But I still get the same error:

Schema specified is not valid. Errors:
(8,6) : error 0040: The Type nclob is not qualified with a namespace or alias. Only primitive types can be used without qualification.

I have seen that in the link you mentioned version 8.3.161. I'm using the trial version, and that gives me:

- Devart.Data version 5.0.792.0
- Devart.Data.Oracle version 7.9.333.0
- Devart.Data.Oracle.Entity version 7.9.333.0
- Devart.Data.Oracle.Web version 7.9.333.4

Is that right?

Regards

Arya Stark
AryaStark
 
Posts: 4
Joined: Fri 17 Oct 2014 09:39

Re: Membership Provider and Entities

Postby Shalex » Tue 21 Oct 2014 11:02

7.9.333 (23-Sep-13) is outdated version of dotConnect for Oracle (it doesn't recognize the ProviderManifestToken option you have specified): http://www.devart.com/dotconnect/oracle/revision_history.html. Please try using the latest build (8.4.264) which can be downloaded from http://www.devart.com/dotconnect/oracle/download.html. Does this help?
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44

Re: Membership Provider and Entities

Postby AryaStark » Tue 21 Oct 2014 13:57

Well, I have downloaded the latest version and now I get a message saying that my trial period has expired. I keep getting the same error, but I assume that is because the trial doesn't let me change the project anyway. Any help with this?

I need to use security question and answer to create and account (for my web project). Does dotConnect provide this functionality? I can't find any information about it. And I would like to test it before I decided to ask my company to buy the software.

Thanks

Arya Stark
AryaStark
 
Posts: 4
Joined: Fri 17 Oct 2014 09:39

Re: Membership Provider and Entities

Postby Pinturiccio » Thu 23 Oct 2014 09:29

We have answered you via e-mail.
Pinturiccio
Devart Team
 
Posts: 1866
Joined: Wed 02 Nov 2011 09:44

Re: Membership Provider and Entities

Postby AryaStark » Fri 24 Oct 2014 10:44

I'm using now the latest version of Devart.Data.Oracle but I still get the same error message.

I have two projects, one that it's only a class library, and contains the entities, and a web project that contains the Membership Provider.

On the Class Library:

App.config:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <connectionStrings>
        <add name="THESISINTERNALEntitiesConnectionString" connectionString="metadata=res://*/MembershipProviderModel.csdl|res://*/MembershipProviderModel.ssdl|res://*/MembershipProviderModel.msl;provider=Devart.Data.Oracle;provider connection string=&quot;User Id=****;Password=****;Server=TEST;Home=oraclient12home1;Persist Security Info=True&quot;"
            providerName="System.Data.EntityClient" />
    </connectionStrings>
</configuration>


MembershipProviderModel.edml:

Code: Select all
<Schema Namespace="THESISINTERNALModel.Store" Alias="Self" Provider="Devart.Data.Oracle" ProviderManifestToken="Oracle, 11.1.0.7;CodeFirstOptions.ColumnTypeCasingConventionCompatibility=False;" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:devart="http://devart.com/schemas/edml/StorageSchemaExtensions/1.0" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">


On the Web Project:

Web.config:

Code: Select all
<connectionStrings>
    <add name="DefaultConnection" connectionString="User Id=****;Password=****;Data Source=TEST"
      providerName="Devart.Data.Oracle" />
  </connectionStrings>

...

<membership defaultProvider="OracleExtendedMembershipProvider">
      <providers>
        <clear/>
        <add name="OracleExtendedMembershipProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedMembershipProvider, Devart.Data.Oracle.Web, Version=8.4.274.4, Culture=neutral, PublicKeyToken=09af7300eec23701" description="dotConnect for Oracle extended membership provider" connectionStringName="DefaultConnection" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="OracleExtendedRoleProvider">
      <providers>
        <clear/>
        <add name="OracleExtendedRoleProvider" type="Devart.Data.Oracle.Web.Providers.OracleExtendedRoleProvider, Devart.Data.Oracle.Web, Version=8.4.274.4, Culture=neutral, PublicKeyToken=09af7300eec23701" description="dotConnect for Oracle extended role provider" connectionStringName="DefaultConnection" />
      </providers>
    </roleManager>


I add the class library as a reference into the web project. But as soon as I do that, I get the error message. Both projects work fine separately, but I cannot put them together.

Schema specified is not valid. Errors:
(8,6) : error 0040: The Type nclob is not qualified with a namespace or alias. Only primitive types can be used without qualification.
AryaStark
 
Posts: 4
Joined: Fri 17 Oct 2014 09:39

Re: Membership Provider and Entities

Postby Shalex » Tue 28 Oct 2014 06:32

Please put the entry with adding THESISINTERNALEntitiesConnectionString conection string in web.config of your web project (instead of Class Library's app.config).
If this doesn't help, send us a small test project with the corresponding DDL/DML script so that we can reproduce the issue in our environment.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle