dbTalk Databases Forums  

Sybase AsaClient and DbProviderFactories

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Sybase AsaClient and DbProviderFactories in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JC
 
Posts: n/a

Default Sybase AsaClient and DbProviderFactories - 10-22-2007 , 09:20 PM






Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory = DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to use
Asaclient objects with the ADO.NET factories?

Thanks in advance


Reply With Quote
  #2  
Old   
Nick Elson
 
Posts: n/a

Default Re: Sybase AsaClient and DbProviderFactories - 10-23-2007 , 09:24 AM






It could just be your string. That should probably be

"iAnywhere.Data.Asaclient"

if you are using the version 9.0.x product. For version 10
there was a name change to

"iAnywhere.Data.SQLAnywhere"

[both are supported in 10.0 but use the latter for more
complete .Net support].

You will find most of our examples us the `using iAnywhere.Data. ...`
convention but the above info. may be sufficient to get
you past this.


"JC" <jeffreycameron (AT) gmail (DOT) com> wrote

Quote:
Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory = DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to use
Asaclient objects with the ADO.NET factories?

Thanks in advance




Reply With Quote
  #3  
Old   
JC
 
Posts: n/a

Default Re: Sybase AsaClient and DbProviderFactories - 10-23-2007 , 04:15 PM



Thanks for your reply Nick,

We skipped using a provider string and used a DataRow from the
GetProviderFactories method to try and get ourselves a
DbProviderFactory object since this removed any possibility of usnig
the wrong string. However, when we did so we received a
System.IO.FileLoadException saying "the given assembly name or
codebase was invalid".

Can you or someone else provide any insight on why this happened?

Thanks.

On Oct 23, 10:24 am, "Nick Elson"
<@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
Quote:
It could just be your string. That should probably be

"iAnywhere.Data.Asaclient"

if you are using the version 9.0.x product. For version 10
there was a name change to

"iAnywhere.Data.SQLAnywhere"

[both are supported in 10.0 but use the latter for more
complete .Net support].

You will find most of our examples us the `using iAnywhere.Data. ...`
convention but the above info. may be sufficient to get
you past this.

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193106043.432246.152510 (AT) q5g2000prf (DOT) googlegroups.com...



Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory = DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to use
Asaclient objects with the ADO.NET factories?

Thanks in advance- Hide quoted text -

- Show quoted text -



Reply With Quote
  #4  
Old   
Nick Elson
 
Posts: n/a

Default Re: Sybase AsaClient and DbProviderFactories - 10-24-2007 , 10:07 AM



Okay, this is where my own ignorance is probably
start to show. But here goes ...

If I had to guess at your usage, it sounds like you
are trying to do this with version 9. If that is your
actual case, that provider was implemented around
the Visual Studio .Net 2003 and .NET 1.0 and
seems not to have the required support for what
you are attempting to do, but V10 should.

The DbProiderFactory interface was not implemented
in 9.0.x but was added to the Version 10 provider
which is designed for Visual Studio .Net 2005 and
..NET 2.0 and (with a name change) implement a
new class for this 'SAFactory'.

So with 9 you probably cannot do this.
With 10 you can probably can do this but
you need to use the version 10 provider
[9 is still included for backward compatability
but will not include the changes] which will
be using the name

'iAnywhere.Data.SQLAnywhere'

instead of the one you are currently using. Both
will be there in a V10 installation but you will need
to use the newer one for this.

For more information start with the v10 docs

http://www.ianywhere.com/developer/p...velopment.html


"JC" <jeffreycameron (AT) gmail (DOT) com> wrote

Quote:
Thanks for your reply Nick,

We skipped using a provider string and used a DataRow from the
GetProviderFactories method to try and get ourselves a
DbProviderFactory object since this removed any possibility of usnig
the wrong string. However, when we did so we received a
System.IO.FileLoadException saying "the given assembly name or
codebase was invalid".

Can you or someone else provide any insight on why this happened?

Thanks.

On Oct 23, 10:24 am, "Nick Elson"
@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
It could just be your string. That should probably be

"iAnywhere.Data.Asaclient"

if you are using the version 9.0.x product. For version 10
there was a name change to

"iAnywhere.Data.SQLAnywhere"

[both are supported in 10.0 but use the latter for more
complete .Net support].

You will find most of our examples us the `using iAnywhere.Data. ...`
convention but the above info. may be sufficient to get
you past this.

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193106043.432246.152510 (AT) q5g2000prf (DOT) googlegroups.com...



Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory = DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to use
Asaclient objects with the ADO.NET factories?

Thanks in advance- Hide quoted text -

- Show quoted text -





Reply With Quote
  #5  
Old   
JC
 
Posts: n/a

Default Re: Sybase AsaClient and DbProviderFactories - 10-24-2007 , 05:54 PM



Thanks muchly Nick,

Your guess is bang on the money. The version of the driver we were
attempting to use is 9.0.2.2038. We are actually using the ASA
included with the Sybase IQ 12.7 client installation package.

This package dropped two directories. The standard win32 directory
with iAnywhere.Data.AsaClient.Dll, dbdata9.dll, dblgen9.dll all at
[9.0.2.2041]. When I add this drivers to my project and view the
reference with the Object Browser there is nothing about AsaFactory
classes as one would expect. However, there is a subdirectory of this
called VS8 (which led me to believe it was .NET 2.0 compatible) that
contains just the iAnywhere.Data.AsaClient.Dll file at version
[9.0.2.2038]. When I add a reference to this and view in the Object
Browser there is an AsaFactory object. Also when I view my
machine.config file after installing the Sybase IQ 12.7 package in the
DbProvider section there is an entry for the iAnywhere .NTt Data
Provider. Also, yesterday I was able to successfully call
DbProviderFactory.GetFactory("iAnywhere.Data.AsaCl ient") and retrieve
a valid object.

My problem now is that I get a mismatched DLL version error. This is
because there was no dbdata9.dll and dblgen9.dll in the VS8
subdirectory at version 9.0.2.2038 so the program goes and reads the
9.0.2.2041 versions and since these are not the same as the iAnywhere
DLL I get a mismatched DLL error.

It looks to me at this point like either:

1. Sybase pooched the installation package and forgot the dbdata9.dll
and dblgen.dll in the VS8 subdirectory OR
2. The VS8 subdirectory was never supposed to be there but slipped
into the setup executable somehow. My DBAs are hopefully contacting
Sybase as we speak on this matter.

Your response about v9 vs. v10 was very helpful too. I might see if
we can get the v10 driver licensed (or maybe we already have it?) and
work with that instead.

If you have any other comments they would be appreciated!

Thanks again.


On Oct 24, 11:07 am, "Nick Elson"
<@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
Quote:
Okay, this is where my own ignorance is probably
start to show. But here goes ...

If I had to guess at your usage, it sounds like you
are trying to do this with version 9. If that is your
actual case, that provider was implemented around
the Visual Studio .Net 2003 and .NET 1.0 and
seems not to have the required support for what
you are attempting to do, but V10 should.

The DbProiderFactory interface was not implemented
in 9.0.x but was added to the Version 10 provider
which is designed for Visual Studio .Net 2005 and
.NET 2.0 and (with a name change) implement a
new class for this 'SAFactory'.

So with 9 you probably cannot do this.
With 10 you can probably can do this but
you need to use the version 10 provider
[9 is still included for backward compatability
but will not include the changes] which will
be using the name

'iAnywhere.Data.SQLAnywhere'

instead of the one you are currently using. Both
will be there in a V10 installation but you will need
to use the newer one for this.

For more information start with the v10 docs

http://www.ianywhere.com/developer/p...nywhere/1001/e...

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193174157.902175.312340 (AT) q3g2000prf (DOT) googlegroups.com...

Thanks for your reply Nick,

We skipped using a provider string and used a DataRow from the
GetProviderFactories method to try and get ourselves a
DbProviderFactory object since this removed any possibility of usnig
the wrong string. However, when we did so we received a
System.IO.FileLoadException saying "the given assembly name or
codebase was invalid".

Can you or someone else provide any insight on why this happened?

Thanks.

On Oct 23, 10:24 am, "Nick Elson"
@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
It could just be your string. That should probably be

"iAnywhere.Data.Asaclient"

if you are using the version 9.0.x product. For version 10
there was a name change to

"iAnywhere.Data.SQLAnywhere"

[both are supported in 10.0 but use the latter for more
complete .Net support].

You will find most of our examples us the `using iAnywhere.Data. ...`
convention but the above info. may be sufficient to get
you past this.

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193106043.432246.152510 (AT) q5g2000prf (DOT) googlegroups.com...

Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory = DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to use
Asaclient objects with the ADO.NET factories?

Thanks in advance- Hide quoted text -

- Show quoted text -



Reply With Quote
  #6  
Old   
Nick Elson
 
Posts: n/a

Default Re: Sybase AsaClient and DbProviderFactories - 10-25-2007 , 11:14 AM



Check out my most recent point on another thread on this newsground.
[hint: Your assembly sounds confused]

"JC" <jeffreycameron (AT) gmail (DOT) com> wrote

Quote:
Thanks muchly Nick,

Your guess is bang on the money. The version of the driver we were
attempting to use is 9.0.2.2038. We are actually using the ASA
included with the Sybase IQ 12.7 client installation package.

This package dropped two directories. The standard win32 directory
with iAnywhere.Data.AsaClient.Dll, dbdata9.dll, dblgen9.dll all at
[9.0.2.2041]. When I add this drivers to my project and view the
reference with the Object Browser there is nothing about AsaFactory
classes as one would expect. However, there is a subdirectory of this
called VS8 (which led me to believe it was .NET 2.0 compatible) that
contains just the iAnywhere.Data.AsaClient.Dll file at version
[9.0.2.2038]. When I add a reference to this and view in the Object
Browser there is an AsaFactory object. Also when I view my
machine.config file after installing the Sybase IQ 12.7 package in the
DbProvider section there is an entry for the iAnywhere .NTt Data
Provider. Also, yesterday I was able to successfully call
DbProviderFactory.GetFactory("iAnywhere.Data.AsaCl ient") and retrieve
a valid object.

My problem now is that I get a mismatched DLL version error. This is
because there was no dbdata9.dll and dblgen9.dll in the VS8
subdirectory at version 9.0.2.2038 so the program goes and reads the
9.0.2.2041 versions and since these are not the same as the iAnywhere
DLL I get a mismatched DLL error.

It looks to me at this point like either:

1. Sybase pooched the installation package and forgot the dbdata9.dll
and dblgen.dll in the VS8 subdirectory OR
2. The VS8 subdirectory was never supposed to be there but slipped
into the setup executable somehow. My DBAs are hopefully contacting
Sybase as we speak on this matter.

Your response about v9 vs. v10 was very helpful too. I might see if
we can get the v10 driver licensed (or maybe we already have it?) and
work with that instead.

If you have any other comments they would be appreciated!

Thanks again.


On Oct 24, 11:07 am, "Nick Elson"
@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
Okay, this is where my own ignorance is probably
start to show. But here goes ...

If I had to guess at your usage, it sounds like you
are trying to do this with version 9. If that is your
actual case, that provider was implemented around
the Visual Studio .Net 2003 and .NET 1.0 and
seems not to have the required support for what
you are attempting to do, but V10 should.

The DbProiderFactory interface was not implemented
in 9.0.x but was added to the Version 10 provider
which is designed for Visual Studio .Net 2005 and
.NET 2.0 and (with a name change) implement a
new class for this 'SAFactory'.

So with 9 you probably cannot do this.
With 10 you can probably can do this but
you need to use the version 10 provider
[9 is still included for backward compatability
but will not include the changes] which will
be using the name

'iAnywhere.Data.SQLAnywhere'

instead of the one you are currently using. Both
will be there in a V10 installation but you will need
to use the newer one for this.

For more information start with the v10 docs


http://www.ianywhere.com/developer/p...nywhere/1001/e...

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193174157.902175.312340 (AT) q3g2000prf (DOT) googlegroups.com...

Thanks for your reply Nick,

We skipped using a provider string and used a DataRow from the
GetProviderFactories method to try and get ourselves a
DbProviderFactory object since this removed any possibility of usnig
the wrong string. However, when we did so we received a
System.IO.FileLoadException saying "the given assembly name or
codebase was invalid".

Can you or someone else provide any insight on why this happened?

Thanks.

On Oct 23, 10:24 am, "Nick Elson"
@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote:
It could just be your string. That should probably be

"iAnywhere.Data.Asaclient"

if you are using the version 9.0.x product. For version 10
there was a name change to

"iAnywhere.Data.SQLAnywhere"

[both are supported in 10.0 but use the latter for more
complete .Net support].

You will find most of our examples us the `using iAnywhere.Data. ...`
convention but the above info. may be sufficient to get
you past this.

"JC" <jeffreycame... (AT) gmail (DOT) com> wrote in message

news:1193106043.432246.152510 (AT) q5g2000prf (DOT) googlegroups.com...

Hello all,

My team is trying to use the iAnywhere.Sybase.Asaclient (middle part
might be spelled incorrect) in our C# project with a
DbProviderFactory
class to generate new code.

However when we try to create a new factory with DbProviderFactory
factory =
DbProviderFactories.GetFactory("iAnywhere.Sybase.A saclient).

This returns an ArgumentException to us.

Is there something special we need to install or do to be able to
use
Asaclient objects with the ADO.NET factories?

Thanks in advance- Hide quoted text -

- Show quoted text -





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.