"relation \"table_name\" does not exist"

"relation \"table_name\" does not exist"

Postby Husniddin » Wed 26 Aug 2015 09:40

Hi,
I'm using Devart dotConnect product to connect to a PostgreSql database. I have problem with Devart Rolemanager. There is already an object named 'AspNetRoles' in the database, but Devart.Data.PostgreSql.Web.dll needs name of table with lower case as this like : "aspnet_roles" . I don't want to change my table names in DB , However it's using in another places.

How can I do that Devart.Data.PostgreSql.Web.dll enabling my table names with mixed cases ("AspNetRoles") ?

I'm getting Error Exception when I use this operation:

@if (User.IsInRole("admin")) {

}
Exception:

An exception of type 'System.Configuration.Provider.ProviderException' occurred > in Devart.Data.PostgreSql.Web.dll but was not handled in user code
Error: {Error: 42P01: relation "aspnet_roles" does not exist}
ErrorCode : -2147467259


All your answers will be appreciated:)

Thank you!
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26

Re: "relation \"table_name\" does not exist"

Postby Pinturiccio » Thu 27 Aug 2015 10:16

The names of the tables we use are hardcoded, and it is not possible to use other tables. You can solve it in two ways:
1. migrate data from your tables to ours and then work with our tables;
2. implement your own Membership and Role providers that will use your existing tables.
Pinturiccio
Devart Team
 
Posts: 2021
Joined: Wed 02 Nov 2011 09:44

Re: "relation \"table_name\" does not exist"

Postby Husniddin » Thu 27 Aug 2015 11:20

Thank you for your answer,

I just migrated my data to your tables ,so I get next Exception in "applicationname" column. But it's blank now . Can you tel me please , what can I feel in this "applicationname" column?

Thanks!
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26

Re: "relation \"table_name\" does not exist"

Postby Husniddin » Thu 27 Aug 2015 11:22

Pinturiccio wrote:The names of the tables we use are hardcoded, and it is not possible to use other tables. You can solve it in two ways:
1. migrate data from your tables to ours and then work with our tables;
2. implement your own Membership and Role providers that will use your existing tables.



Thank you for your answer,

I just migrated my data to your tables ,so it's working fine now but I get next Exception in
"(u.applicationname)=$1" column and (r.applicationname) = $2. But it's blank now . Can you tel me please , what can I feel in this "(u.applicationname)=$1/(r.applicationname)=$2" columns?

So , the function "User.IsInRole ()" not working yet.

@if(User.IsInRole("admin"))
{
<p>Test Admin page!</p>
}

Here is SQL erro code:

Code: Select all
SELECT rolename from aspnet_users u, aspnet_roles r, aspnet_usersinroles ur WHERE LOWER(u.applicationname) = $1 AND LOWER(r.applicationname) = LOWER(u.applicationname) AND u.userid = ur.userid AND r.roleid = ur.roleid AND LOWER(username) = $2

in Quick Watch: (User.IsInRole("admin")) returns FALSE
Thanks!
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26

Re: "relation \"table_name\" does not exist"

Postby Pinturiccio » Fri 28 Aug 2015 14:49

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

Re: "relation \"table_name\" does not exist"

Postby Husniddin » Mon 31 Aug 2015 09:03

Pinturiccio wrote:We have answered you via e-mail.


Thank you very much , it's WORKING! :)
Husniddin
 
Posts: 8
Joined: Mon 10 Aug 2015 08:26


Return to dotConnect for PostgreSQL