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!
"relation \"table_name\" does not exist"
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: "relation \"table_name\" does not exist"
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.
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.
Re: "relation \"table_name\" does not exist"
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!
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!
Re: "relation \"table_name\" does not exist"
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
Thanks!
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: "relation \"table_name\" does not exist"
We have answered you via e-mail.
Re: "relation \"table_name\" does not exist"
Thank you very much , it's WORKING!Pinturiccio wrote:We have answered you via e-mail.