cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Anywhere connection issue - Communication function SQLPresSyncPoint code 2

0 Kudos
591

Hi, I am trying to connect to the database using SQL Anywhere 17 and Sap.Data.SQLAnywhere.Core.v2.1. I have created one test app:

using (SAConnection connection = new SAConnection(this.connString.Text))
{
    try
    {
        // Open the connection
        connection.Open();
        // Create a command
        using (SACommand command = new SACommand("SELECT * FROM F1.FK_Artikel", connection))
        {
            // Execute the command and retrieve data
            using (SADataReader reader = command.ExecuteReader())
            {
                // Read data
                while (reader.Read())
                {
                    log(reader["ColumnName"].ToString());
                }
            }
        }
    }
    catch (SAException ex)
    {
        // Handle exceptions
        log("Error: " + ex.Message);
    }
}
but I got error in log:
09:18:19 Application information:
09:18:19 HOST=MyServer;OSUSER=admin;OS='Windows 8 Build 9200 ';EXE=C:\\Users\\admin\\Desktop\\Testing\\x86-1\\Debug\\net6.0-windows\\Test2.exe;PID=0x4038;THREAD=0x3dfc;VERSION=17.0.11.7058;API=ADO.NET;TIMEZONEADJUSTMENT=120
09:18:19 Attempting to connect using:
UID=User1;PWD=**;DBN=Db2;DBF=\\192.168.100.192\\db\\mydb.db;ServerName=mysrv;LOG=MyLogFile.txt;PROWS=200;CPOOL=NO
09:18:19 Attempting to connect to a running server...
09:18:19 Trying to start SharedMemory link ...
09:18:19     SharedMemory link started successfully
09:18:19 Attempting SharedMemory connection (no sasrv.ini cached address)
09:18:19 Connected to server over SharedMemory
09:18:19 Connected to SQL Anywhere Server version 17.0.11.6933
09:18:19 Connected to the server, attempting to connect to a running database...
09:18:19 [  395] Connected to database successfully
09:18:19 [  395] Communication function SQLPresSyncPoint code 2
09:18:19 [  395] Communication function i_cs_HandleSQLPresError code 2

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you capture the stack for the exception (or even just the message as the handler appears to be doing now). The client "log" is reporting a general error so that it not that helpful.

0 Kudos

I get this error in exception: SQL Anywhere .NET Data Provider : Communication error (-85) Is there any other log file that I can check?

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

I would suggest getting the full stack. Both the exception message or the client debug log are very generic. I would consider enabling server communication diagnsotics by adding -z -o <filespec>. These can also be set with sa_server_option procedure to set DebuggingInformation and ConsoleLogFile.

Accepted Solutions (0)

Answers (0)