Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in August and this forum will be retired.

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

asked 22 May, 03:32

GoranV's gravatar image

GoranV
11112
accept rate: 0%

edited 22 May, 10:44

Volker%20Barth's gravatar image

Volker Barth
40.4k365553826

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.

(22 May, 10:14) Chris Keating
Replies hidden

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

(22 May, 10:32) GoranV

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.

(22 May, 14:08) Chris Keating
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×23

question asked: 22 May, 03:32

question was seen: 361 times

last updated: 22 May, 14:08