The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.


I built a Windows Service that tries to connect to a SA 16 database server (64bit) running on a 64bit Windows Server 2008 R2 (with full .Net framework 4.5) and it fails to open a connection:

*Connect : System.MissingMethodException: Method not found: 'IntPtr System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(!!0)'. at iAnywhere.Data.SQLAnywhere.SACommand._ExecuteReader(CommandBehavior commandBehavior, Boolean isExecuteScalar, Boolean isBeginExecuteReader)    at iAnywhere.Data.SQLAnywhere.SACommand.ExecuteScalar() at iAnywhere.Data.SQLAnywhere.SAConnection.Open()*

My application references thr ADO.NET provider: iAnywhere.Data.SQLAnywhere.v4.5.dll (Ver

Based on the decompiler, SACommand._ExecuteReader calls at one point PInvokeMethods.AsaCommand__ExecuteReader which is defined as:

[DllImport("dbdata16.dll", CharSet=CharSet.None, ExactSpelling=false)] public static extern int AsaCommand_ExecuteReader(int idCmd, int inputParmCount, IntPtr inputParmValues, ref int outputParmCount, ref IntPtr outputParmValues, ref int idReader, ref int rowCount);

As the documentation describes and upon starting the service, the ADO.NET provider unpacks the file dbdata16.dll (64bit, under C:\Windows\Temp{GUID}_1600.x64__1

Looking at this file with DependencyWalker there sure is an AsaCommand_ExecuteReader function in this library, which I think the PInvoke call is trying to reach.

Is it possible the service is loading a different version of dbdata16.dll? (not likely since I can't find other dbdata16.dll files on the system)

Thank you!

asked 18 Feb '16, 07:51

tzup's gravatar image

accept rate: 0%

edited 18 Feb '16, 13:36

Breck%20Carter's gravatar image

Breck Carter

Since dbdata16.dll should be matched exactly with the provider that contains it, there would seem to be little possibility that there is a mismatch there. Thre are dependencies on other libraries though. Those would include the ICU libraries (dbicu*16.dll) and the LanGuage libraries (dblgEN16.dll for instance) and if those are not compatable that may cause an issue.

The entry point itself is also not something new so I would lean towards a mixed/broken installation with other such libraries.


(19 Feb '16, 13:34) Nick Elson S...

Please try target .NET Framework 4.5.1 or higher in Visual Studio for your project.

permanent link

answered 25 Feb '16, 03:42

Stefan's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 18 Feb '16, 07:51

question was seen: 908 times

last updated: 25 Feb '16, 03:46