Error while creating logging configuration for database logging

Topics: Data Access Application Block, Logging Application Block
Aug 18, 2009 at 2:58 PM

Hi,

I have just created a sampe console application with just one class and with the following code to write log entries to the database.

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            LogEntry logEntry = new LogEntry();
            logEntry.EventId = 1;
            logEntry.Priority = 1;
            logEntry.Message = "Message";
            logEntry.Categories.Add("All");
            Logger.Write(logEntry);
        }
    }
}
I tried to configure the logging application blocks. I have created a database trace listener and the text formatter. 
While creating the database trace listener, it has created the data access application block called "LocalSqlServer" with the following connectionstring
"data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
I have installed the sql server developer edition in my machine. I tried to change it to the localhost and to the database. 
But it is giving the following error.
"The user instance login flag is not supported on this version of SQL Server. The connection will be closed"
What should i do to resolve this error?
Aug 19, 2009 at 6:35 AM

Hi, just add a new connection string in the DAAB section, don't edit the LocalSqlServer connection string as it will only revert to its original value. It is a connection string from the machine.config(http://blogs.msdn.com/tomholl/archive/2006/04/25/583796.aspx).

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com