cancel
Showing results for 
Search instead for 
Did you mean: 

ADO.NET deployment using different versions of ianywhere.data.sqlanywhere

Former Member
0 Kudos

Hi

I'm currently working on a C# program that uses ianywhere.data.sqlanywhere.v.4.5.dll (16.0.0.20754) as its referenced ADO.NET 4.5 assembly.  Some of our clients are also running older versions of SQL Anywhere (12 and 11). 

When I've deployed the application with to a test machine with SA 12.0.1.4231 it requires the bound assembly version (16) above to be available for the program to execute correctly.  I can solve this problem by installing a SA 16 client on the tests machine first and then loading the ianywhere.data.sqlanywhere.v.4.5.dll (12.0.1.42314) into the deployment directory and it works fine.

Is there a cleaner way of doing this?  I currently have an application manifest file for the Powerbuilder and C# application so could add code to this.

Thanks in advance

Allan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Allan,

we've had a similar problem. We solved it using C# and reflection. We're looking for an assembly and loading it at runtime. Then we're using reflection to get the type of the SAProviderFactory. This type has a function CreateConnection which returns an Instance of a DbConnection. You would have to change your program to use DbConnection instead of SaConnection.

Hope that helps

Kind regards

Oliver Albrecht

DATAflor AG

Former Member
0 Kudos

Hi Oliver

I've just put a change through the code using DbProviderFactory so that the code becomes more DB independent as it runs against SQL Server as well as SA.  I hadn't actually gone back and checked it against the previous SA 11 version so I'll give it a go.

Thanks for your help.

Allan

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Allan,

Have you considered using the Deployment Wizard? You can easily deploy the client portions of SQL Anywhere to your end users.

More read: http://dcx.sap.com/index.html#sa160/en/dbprogramming/pg-deploy.html

Regards,

Jinwoo

Former Member
0 Kudos

Hi Jinwoo

I've already built a v12 SA MSI client install using the wizard which works fine but unfortunately unless I also run a v16 SA client MSI on the client machine, I get an issue with the v16 SA assembly not being found.  I'm looking for a way to roll out an ADO.NET program that was built targeted to v16 SA on a v12 SA client machine that doesn't require me to install a full v16 SA client as well.

I'm trying to avoid having to build a project for SA v16 and another to support v12 of SQL Anywhere ie with a build assembly referencing ianywhere.data.sqlanywhere.v.4.5.dll v12.

Cheers

Allan

Former Member
0 Kudos

Hi Allan,

For SQL Anywhere provider for .Net Framework 4.5 client applications, you need to have (DCX link😞

  • iAnywhere.Data.SQLAnywhere.v4.5.dll
  • policy.16.0.iAnywhere.Data.SQLAnywhere.v4.5.dll
  • dblgen16.dll (en for English)
  • dbicu16.dll
  • dbicudt16.dll

You can include these files in the same directory as your application. You can use Process Monitor to make sure the application is loading the right DLLs.

Regards,

Jinwoo

Former Member
0 Kudos

Thanks but I've already tried that combination and unfortunately it doesn't work either.  I think it needs to have the v16 ianywhere.data.sqlanywhere in the GAC along with the v12.  The easiest option looks like building a version of C# solution with the v12 ianywhere.data.sqlanywhere assembly in it.

Thanks anyway.

Allan