Have you verified that the connection string works using normal
ADO.Net:

 string connectionString = 
@"Provider=Sybase.Ase;Data Source=ASTOR;Port=5004;Database=QUAD0006;Min
Pool Size=1; Max Pool Size=2;User Id=xxxxxxx;Password=xxxxxxx";

 IDbConnection conn = new Sybase.Data.AseClient.AseConnection(
  connectionString);
  conn.Open();
  conn.Close();

If that works, try this:

 IDbConnection conn = new Sybase.Data.AseClient.AseConnection(
  connectionString);
 IDbConnection clonedConn = ((ICloneable)conn).Clone();
 clonedConn.Open();
 clonedConn.Close();

There have bugs with other providers (MySql Connector?) saying they
implement ICloneable but throw an exception when the object is cloned.

--- "Tan, Lee" <[EMAIL PROTECTED]> wrote:

> I'm trying to setup my providers.config file to use the SybaseASE
> dlls
> (Sybase.Data.AseClient.dll).  If someone could answer my problem
> directly, I would appreciate that, otherwise if someone could point
> me
> to some detailed docs about the providers.config file that would be
> helpful too...
> 
> I took the iBatisTutorial sample
>
http://prdownloads.sourceforge.net/ibatisnet/Tutorial-1.2.1.zip?download
> and got that running as is.  I'm now trying to switch the sample app
> to
> use my Sybase Database.  This is what I've done...
> 
> In the providers.config file I added:
> 
>       <provider
>               name="SybaseAse1.1"
>               description="Sybase Adaptive Server Enterprise 12.5,
> provider V1.1.411 in framework .NET V1.1"
>               default="true"
>               assemblyName="Sybase.Data.AseClient, Version=1.1.411.0,
> Culture=neutral, PublicKeyToken=26e0f1529304f4a7"
>               connectionClass="Sybase.Data.AseClient.AseConnection"
>               commandClass="Sybase.Data.AseClient.AseCommand"
>               parameterClass="Sybase.Data.AseClient.AseParameter"
>               parameterDbTypeClass="Sybase.Data.AseClient.AseDbType"
>               parameterDbTypeProperty="AseDbType"
>               dataAdapterClass="Sybase.Data.AseClient.AseDataAdapter"
>       
> commandBuilderClass="Sybase.Data.AseClient.AseCommandBuilder"
>               usePositionalParameter="false"
>               useParameterPrefixInSql="true"
>               useParameterPrefixInParameter = "true"
>               parameterPrefix="@"
>               />
> 
> And in the properties.config I put:
> 
> <settings>
>       <!--   User application and configured property settings go
> here.-->
>       <!--   Example: <add key="settingName" value="settingValue"/>
> -->
>       <add key="provider" value="SybaseAse1.1" />
>       <add 
>               key="connectionString" 
>               value="Provider=Sybase.Ase;Data
> Source=ASTOR;Port=5004;Database=QUAD0006;Min Pool Size=1; Max Pool
> Size=2;User Id=xxxxxxx;Password=xxxxxxx" />
>       <add key="root" value="./" />           
> </settings>
> 
> When I run it, this is the error I get:
> Object reference not set to an instance of an object. 
> Description: An unhandled exception occurred during the execution of
> the
> current web request. Please review the stack trace for more
> information
> about the error and where it originated in the code. 
> 
> Exception Details: System.NullReferenceException: Object reference
> not
> set to an instance of an object.
> 
> Source Error: 
> 
> 
> Line 15:              public IList SelectAll ()
> Line 16:              {
> Line 17:                      return Mapper ().QueryForList ("Select",
> null);
> Line 18:              }
> Line 19:      
> 
> Source File: c:\inetpub\wwwroot\ibatistutorial\model\personhelper.cs
> Line: 17 
> 
> Stack Trace: 
> 
> 
> [NullReferenceException: Object reference not set to an instance of
> an
> object.]
>    Sybase.Data.AseClient.ConnectionProperties.Contains(String
> origName)
>    Sybase.Data.AseClient.ConnectionProperties.GetUsedPropName(String
> origName)
>    Sybase.Data.AseClient.ConnectionProperties.GetValue(String
> origName)
>    Sybase.Data.AseClient.AseConnection.set_ConnectionString(String
> value)
>    Sybase.Data.AseClient.AseConnection..ctor(String connectionString)
>    Sybase.Data.AseClient.AseConnection.Clone()
>    IBatisNet.Common.Provider.GetConnection()
>    IBatisNet.DataMapper.SqlMapSession.OpenConnection()
>    IBatisNet.DataMapper.SqlMapper.QueryForList(String statementName,
> Object parameterObject)
>    iBatisTutorial.Model.PersonHelper.SelectAll() in
> c:\inetpub\wwwroot\ibatistutorial\model\personhelper.cs:17
>    iBatisTutorial.Web.Forms.PersonPage.List_Load() in
> c:\inetpub\wwwroot\ibatistutorial\webview\forms\person.aspx.cs:24
>    iBatisTutorial.Web.Forms.PersonPage.Page_Load(Object sender,
> EventArgs e) in
> c:\inetpub\wwwroot\ibatistutorial\webview\forms\person.aspx.cs:88
>    System.Web.UI.Control.OnLoad(EventArgs e)
>    System.Web.UI.Control.LoadRecursive()
>    System.Web.UI.Page.ProcessRequestMain()    
> 
> Thanks
> 
> 
> > Lee Tan
> > Information Systems - Software Development
> > 
> > Quad/Graphics
> > 
> > Sussex, Wisconsin
> > 414-566-6716 phone
> > 414-566-4010x6716 beeper 
> > [EMAIL PROTECTED]
> > www.QG.com
> > 
> 

Reply via email to