[Mono-list] Mono WinForms Problems Connecting to Sql 2005

Daniel Morgan monodanmorg at yahoo.com
Sat Feb 3 22:10:18 EST 2007

Note: if you are using Windows Authentication, your
SQL Server and the client computer connecting to this
SQL Server must be on a real Windows NT/2000/2003
Domain for Windows Authentication to work.

Samba may work, but I'm not sure.  

Also, with Mono, you must include your Windows
NT/2000/2003 Domain User and Password when connecting
via Windows Authentication.

You can read more info here about Mono's SqlClient
provider here:


My advice, make sure SQL Server can accept TCP/IP
connections.  Make sure the server is set up for
mix-mode authentication (windows authentication and
sql server authentication).

One more thing, do you even read the replies people
send to you? I asked you this earlier:

How does you connection strings look like?

You can rename your actual user id and password to

Are you using an instance name in your connection
string?  You mentioned you are connecting via SQL
Server Authentication.  

Have you increased the CONNECTION TIMEOUT?  The
default is 15 seconds.

To know for sure you're connecting via .net the same
way you are in mono, add this to your connection
string for running on .net:

;network library=dbmssocn

Then if you get the same thing on .net as you do with
mono, then you know its something with connecting via
TCP/IP.  And if you were using a named instance, then
you may need to open up access to UDP port 1434.

Here is an entry from my blog about this.


Here is the msdn doc on SqlConnection.ConnectionString


--- Austin Winstanley <austin at tradelogic.com> wrote:

> Ok, So on this problem I have narrowed it down. On
> my server I have
> Sql 2000 and Sql 2005 running side by side. i only
> get the connection
> error when trying to connect to sql 2005. I can
> connect to sql 2000
> just fine.
> The only difference is the instance name. To connect
> to 2000 I would
> just use my ip address. But to connect to sql 2005 I
> have to use
> myipaddress\\Server2005. In windows this works, but
> in mac and linux
> it doesnt. So the problem comes down to just the
> Server2005 instance
> name in mac/linux.
> Can anybody help me out with this?? It is driving me
> crazy. Thanks!
> On 1/28/07, URBAN Leos <leos.urban at qds.cz> wrote:
> > Try connection string:
> >
> > this.sqlConnection1.ConnectionString =
> >
> >
> > Leos
> >
> > Austin Winstanley napsal(a):
> > > I am running a Mono Winforms app and i have
> gotten it to run great on
> > > Windows, Linux, and Mac OSX. The problem is I
> can only connect to a
> > > Sql Server 2005 DB from Windows. It is a remote
> DB and it connects
> > > just fine when I am in Windows, but as soon as I
> run my app from Mac
> > > or Linux, It gives me Sql Server does not exist
> or connection denied
> > > error. I'm not understanding why it will connect
> from Windows but not
> > > Mac or Linux. Any help would be great. Thanks!
> > > _______________________________________________
> > > Mono-winforms-list maillist  - 
> Mono-winforms-list at lists.ximian.com
> > >
> > >
> >
> >

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.

More information about the Mono-list mailing list