ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Svancara <rsvanc...@cableone.net>
Subject Re: C# .Net 2.0
Date Mon, 27 Mar 2006 16:43:45 GMT
Nevermind,

I was using the old provider.config file from the original NPetshop.  I 
have to say that it is terribly outdated.

Thanks,

Randall

Randall Svancara wrote:

> Ron,
>
> Thank you for all your help.  I implemented your suggestions and found 
> the online subversion repository great help.
>
> I have Log4net working.  The configuration looks like this in my 
> app.config:
>
>  <configSections>
>    <sectionGroup name="iBATIS">
>      <section name="logging" 
> type="IBatisNet.Common.Logging.ConfigurationSectionHandler, 
> IBatisNet.Common" />
>    </sectionGroup>  </configSections>
>
>  <iBATIS>
>    <logging>
>      <logFactoryAdapter 
> type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA,IBatisNet.Common.Logging.Log4Net">

>
>          <arg key="configType" value="file" />
>          <arg key="configFile" value="Log4Net.config" />
>        </logFactoryAdapter>
>      </logging>
>    </iBATIS>
>
> Although this is a simple test that I am creating, I want to use the 
> DAO components in case I have multiple datasources.  Plus I think it 
> is just good practice to have a good DAO framework to make things 
> cleaner.  Hence the reason I went with Ibatis in the first place.
> One small problem yet remains however.  I am receiving an error:
>
> {"\n- The error occurred while configure provider.\n- The error 
> occurred in <provider name=\"sqlServer1.1\" 
> xmlns=\"http://ibatis.apache.org/dataAccess\" />.  \n- Check the 
> sqlServer1.1."}
>
> In my dao.config, I have this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <daoConfig  xmlns="http://ibatis.apache.org/dataAccess"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
>  <context id="SqlMapDao" default="true">
>
>
>    <!-- ==== Sql Server : SqlClient configuration ========= -->
>        <database>
>      <provider name="sqlServer1.1"/>
>            <dataSource name="SqlServer" connectionString="data 
> source=(local)\NetSDK;database=TEST;user 
> id=sa;password=dofa7h;connection reset=false;connection lifetime=5; 
> min pool size=1; max pool size=50"/>
>        </database>
>
>
>    <daoSessionHandler id="SqlMap">
>      <property name="sqlMapConfigFile" value="sqlMap.config"/>
>    </daoSessionHandler>
>
>    <daoFactory>
>      <dao interface="Test.Persistance.Interface.Accounts.IAccountDao"
>                    
> implementation="Test.Persistence.Dao.Accounts.AccountDao,Test.Persistence.Dao.Accounts"/>

>
>    </daoFactory>
>  </context>
>
> </daoConfig>
>
>
> I can not figure out why the provider portion does not work 
> correctly.  I am using visual studio 2005 with the .net 2.0 
> framework.   My application is a windows based application.  I will 
> eventually be refactoring an application that i support with IBATIS 
> .Net.  Any help anyone has would be appreciated.
> I hope to eventually publish my code online to help others with the 
> same struggles i have....the beauty of open source!!!!
>
>
>
> Ron Grabowski wrote:
>
>> Once the project builds and loads correctly, you may want to use
>> Log4Net instead of the built-in logging facilities. This is what your
>> iBATIS/logging node might look like:
>>
>> <iBATIS>
>> <logging>
>>  <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA,
>> IBatisNet.Common.Logging.Log4Net">
>>   <arg key="configType" value="external" />
>>  </logFactoryAdapter>
>> </logging>       
>> </iBATIS>
>>
>> You'll need to put these two files in your bin directory:
>>
>> log4net.dll
>> IBatisNet.Common.Logging.Log4Net.dll
>>
>> By setting the configType to external, your application is responsible
>> for initializing Log4Net. Here's a link to the Log4Net website:
>>
>> http://logging.apache.org/log4net/
>>
>> --- Ron Grabowski <rongrabowski@yahoo.com> wrote:
>>
>>  
>>
>>> IBatisNet supports a pluggable logging arhcitecture. I (most people?)
>>> use Log4Net. Here's an untested config file that routes log messages
>>> to
>>> System.Diagnostics.Trace which is routed to a text file.
>>>   
>>
>>
>>  
>>
>
>


Mime
View raw message