Hello,

Here my configuration : Visual Studio 2010 ASP.NET 4.0 C# SQL Anywhere Version=12.0.1.37694

When I launch a simple pages on debug mod whith this code, SAConnection block and other code cant be executed. My webpage is pending like i have insert a breakpoint on the .SAConnection. But there is no breakpoint. No information in the output windows.

My web.config : <add assembly="iAnywhere.Data.SQLAnywhere.v4.0, Version=12.0.1.37694, Culture=neutral, PublicKeyToken=F222FC4333E0D400"/>

My code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using iAnywhere.Data.SQLAnywhere;
using System.Configuration;

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        SAConnection conn = new SAConnection("UserID=dba;Password=sql;DataSourceName=demo");

        Label1.Text = "Don' work";
    }
}

asked 27 Sep '12, 08:19

ncholet's gravatar image

ncholet
16112
accept rate: 0%


Lets try and figure out if the problem is with the database engine layer or the .NET layer.

When the code is blocked, if you make another connection to the database engine with dbisql, if you execute sa_conn_info() and sa_locks(), can you see any blocked connections in the database engine that might explain why the new SAConnection() is blocked? You can post the output here if you're not sure how to interpret the results.

permanent link

answered 27 Sep '12, 08:47

Reg%20Domaratzki's gravatar image

Reg Domaratzki
7.6k343116
accept rate: 38%

Thank for your answer.

When the SAConnection() is blocked, i have launch SELECT * FROM sa_conn_info(). Here the result :

Number,Name,Userid,DBNumber,LastReqTime,ReqType,CommLink,NodeAddr,ClientPort,ServerPort,BlockedOn,LockRowID,LockIndexID,LockTable,UncommitOps,ParentConnection 6,'SQL_DBC_505c8d50','DBA',0,'2012-09-27 18:22:18.215','FETCH','local','',0,0,0,0,,'',0, 1,Sybase Central 1,DBA,0,2012-09-27 18:22:15.173,CLOSE,local,,0,0,0,0,(NULL),,0,(NULL)

When I launch select * from sa_locks() there is no result.

additionnal information : I am on windows 7 64 bits with Visual studio 2010 32 bits. (I have install SA 32 and 64 bits).

best regards,

(27 Sep '12, 12:29) ncholet
Replies hidden

Other aditionnal information. If I enter wrong information on the SAConnection, for exemple :

SAConnection conn = new SAConnection("nothing");

I have the same problem.

best regards,

(27 Sep '12, 12:33) ncholet
Replies hidden

This does obviously mean that the problem is not a blocking issue in SQL Anywhere, as your SQL Central connection is the only one currently connected, so your web page code has not connected at all or is already disconnected...

(28 Sep '12, 03:39) Volker Barth
  • How do you define the DSN "Demo"?
  • Is this a User DSN or a System DSN?
  • Is this a 32-bit or 64-bit Operating System running IIS?
  • Is it a 32-bit DSN or 64-bit DSN?
  • Can you run the ODBC admistrator and "Test" the DSN connection to ensure it connects to the database server?
(28 Sep '12, 13:47) Jeff Albion

Add a try catch around it probably you get an exception which is not catched, so your next statement will never execute. Another possible problem which comes to my mind is, that your webpage eventually is not finding all needed assemblies (e.g. for the SA... classes iAnywhere.Data.SQLAnywhere) this will only be identified during load of the page.

permanent link

answered 28 Sep '12, 03:19

Martin's gravatar image

Martin
9.0k130166257
accept rate: 14%

Your answer
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:

×8

question asked: 27 Sep '12, 08:19

question was seen: 2,543 times

last updated: 14 Dec '17, 04:05