質問

We have an MVC application that utilizes the ELMAH module to log any errors that are encountered by our users.

Our DBAs have moved our ELMAH table and stored procedure into a new schema on a database. So now, the default ELMAH pages are failing to access the ELMAH stored procedures and tables since they reside under 'Foo.ELMAH_Error', instead of just 'ELMAH_Error'.

Is there any way to tell the ELMAH module that the table now exists in a new schema?

役に立ちましたか?

解決

In the end, I got this to work by creating a new user for who has full access to the ELMAH procs & tables. I set the default database for the user to the new schema.

This solution appears to work well.

他のヒント

You can create synonyms for ELMAH related objects as follows: Following is for SQL Server. You can apply similar changes if you are using any other databases but may need some changes to syntax.

Create synonym ELMAH_Error for [YourSchema].ELMAH_Error;
Create synonym ELMAH_GetErrorsXml for [YourSchema].ELMAH_GetErrorsXml;
Create synonym ELMAH_GetErrorXml for [YourSchema].ELMAH_GetErrorXml;
Create synonym ELMAH_LogError for [YourSchema].ELMAH_LogError;

After this, ELMAH log to sql will work as usual.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top