[MonoDevelop] [Mono SqlClient Data Provider] SqlException: Timeout expired

steffen-winkler at gmx.de steffen-winkler at gmx.de
Mon Sep 5 17:04:08 EDT 2011


Hi,

today I got the task to test a C#/.NET program with/under mono(develop). After everything seemd to work well (the application compiled in monodevelop without errors and it even started without problems) I got a database connection error, I've tried several thinks to get around this (used IP adress, used hostname, used different types of connectionstrings and so on) I'm now at a point where I'm clueless. I hope that *someone* is able to figure out why mono won't connect to that database.

First some infos about the server:
It's a Microsoft SQL 2008 server with user id/password login. The default connection string (which works fine under .NET/Visual Studio) is this: 
"connect timeout=10;user id=username;data source=servername\\instancename;password=password;persist security info=true;initial catalog=dbname"

note that the data source is escaped (\\).

With mono I tried the following connection strings aside from the default string:
"Database=dbname;Server=servername\\instancename;User ID=username;Password=password;"
"Database=dbname;Server=servername\\instancename;uid=username;pswd=password;"

I always get the following error:
Programm : Mono SqlClient Data Provider
Prozedur : Open
Meldung  : System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> Mono.Data.Tds.Protocol.TdsTimeoutException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
  at Mono.Data.Tds.Protocol.TdsComm..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00105] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.4\mcs\class\Mono.Data.Tds\Mono.Data.Tds.Protocol\TdsComm.cs:117 
  --- End of inner exception stack trace ---
  at System.Data.SqlClient.SqlConnection.Open () [0x00155] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.4\mcs\class\System.Data\System.Data.SqlClient\SqlConnection.cs:554 
  at Projectname.nameOfCsharpClassFile.Initialize (System.Windows.Forms.ComboBox& uSelection, System.Windows.Forms.ComboBox& uBereich) [0x000fa] in D:\nameOfCsharpClassFile:58 
Datentyp : System.Data.SqlClient.SqlConnection
Konvent. : Standard, HasThis
Stack    :   at System.Data.SqlClient.SqlConnection.Open () [0x00155] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.4\mcs\class\System.Data\System.Data.SqlClient\SqlConnection.cs:554 
  at ECArchivServiceManager.ClsUeberwachung.Initialize (System.Windows.Forms.ComboBox& uSelection, System.Windows.Forms.ComboBox& uBereich) [0x000fa] in D:\nameOfCsharpClassFile:58 
Void Open()
Attribute:Public, Virtual, HideBySig
Stack Filename  : D:\nameOfCsharpClassFile
Stack Linenumber: 73
Stack Method    : Void Initialize(System.Windows.Forms.ComboBox ByRef, System.Windows.Forms.ComboBox ByRef)

line 58: con.Open();


-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone


More information about the Monodevelop-list mailing list