This content has been marked as final.
Show 5 replies
-
1. Re: .Net/C# NLog database connection is not working
Alex Keh - Product Manager-Oracle Feb 20, 2013 10:38 PM (in response to 979840)What error are you receiving?
I have no knowledge of how to use NLog, but I notice that your user id and password are blank. -
2. Re: .Net/C# NLog database connection is not working
Mark Williams-Oracle Feb 20, 2013 10:43 PM (in response to 979840)976837 wrote:
Hi,
here is my .config file
<target name="NLOGDatabase" xsi:type="Database" keepConnection="false"
useTransactions="true"
dbProvider="Oracle.DataAccess"
connectionString="Data Source=devl;User Id=;Password=;Integrated Security=no;"
commandText="insert into net_app.NLOGTest2( LOG_LEVEL ,MESSAGE) values( :LOGLEVEL,:MESSAGE)">
<parameter name="LOGLEVEL" layout="${level:uppercase=true}"/>
<parameter name="MESSAGE" layout="$null"/>
</target>
in my project i have a reference to:
Oracle.DataAccess version 4.112.3.0
What am i doing wrong?
Is there better way to do it?
To add to Alex's comments, "Integrated Security" is not a valid connection string attribute for ODP.NET (I think it is for the MS provider).
You should receive an exception similar to the following when using that item in an ODP.NET connection string:
Message='integrated security' is an invalid connection string attribute
Regards,
Mark -
3. Re: .Net/C# NLog database connection is not working
979840 Feb 21, 2013 3:26 PM (in response to Alex Keh - Product Manager-Oracle)Yes, I removed the login and password when i posted it.
NLog doesn't throw errors it just doesn't write to the DB..... -
4. Re: .Net/C# NLog database connection is not working
979840 Feb 21, 2013 4:06 PM (in response to Mark Williams-Oracle)I removed the integrated security ans it still did not work -
5. Re: .Net/C# NLog database connection is not working
Mark Williams-Oracle Feb 21, 2013 4:47 PM (in response to 979840)I, like Alex, am not familiar with NLog; howerver, I did an internet search and it seems like this is not an ODP.NET issue, rather, it is an NLog configuration issue.
Ref this NLog forum post.
From what I gather in that posting you have not correctly specified the value for the dbProvider property.
You have:
dbProvider="Oracle.DataAccess"
Whereas it seems it could be:
dbProvider="Oracle.DataAccess.Client"
- or -
dbProvider="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=<your version here>, Culture=neutral, PublicKeyToken=89b483f429c47342"
As a sample, on my machine this would look like:
dbProvider="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"
The documentation of the dbProvider property states:
"The parameter name should be a provider invariant name as registered in machine.config or app.config. Common values are:"
<snip>
Oracle.DataAccess.Client
<snip>
Alternatively the parameter value can be be a fully qualified name of the provider...
Edited by: Mark Williams on Feb 21, 2013 11:43 AM
Clarified documentation comment.