[Mono-list] Error using test C# program on Mono's MSSQL Start Page

dbowles david_bowles at genpt.com
Thu Sep 3 16:29:23 EDT 2009


Hello,

I have a MS SQL 2005 Server that has been setup for two years that I have
other applications connecting to via ADO and ODBC connections that I am
trying to connect to with Mono.  

The server is setup for either Windows or SQL Authentication.  

I installed SUSE OpenLinux 11.1 on a machine and mono complete comes
pre-installed in the image.  Using the sample SQL Authentication C# program
on http://mono-project.com/SQLClient, I compiled this code and it compiled
correctly.  However, when I try to execute it, I get the following error:

RAYATLDEVWMS1:~/wmsdev> mcs Test.cs -r:System.Data.dll
RAYATLDEVWMS1:~/wmsdev> mono Test.exe

Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open
database "Data" requested by the login. The login failed.
  at System.Data.SqlClient.SqlConnection.ErrorHandler (System.Object sender,
Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.OnTdsErrorMessage
(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.ProcessMessage (TdsPacketSubType subType)
[0x00000] 
  at Mono.Data.Tds.Protocol.Tds.ProcessSubPacket () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.NextResult () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.SkipToEnd () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds70.Connect
(Mono.Data.Tds.Protocol.TdsConnectionParameters connectionParameters)
[0x00000] 
  at System.Data.SqlClient.SqlConnection.Open () [0x00000] 
RAYATLDEVWMS1:~/wmsdev> 

I have also installed CentOS 5, installed Mono complete, compiled the code
without error, executed it with Mono and received the same error message. 
Is there something I should be configuring on the linux/Mono side that is
not covered within the directions on the Mono MS SQL Start Page?

Any ideas on how I can get the code to execute correctly?

I have taken the same code, compiled it with Visual C# Express 2008 and it
executes fine on Windows.  

Thanks,

David Bowles
-- 
View this message in context: http://www.nabble.com/Error-using-test-C--program-on-Mono%27s-MSSQL-Start-Page-tp25279327p25279327.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list