LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-07-2008, 01:39 PM   #16
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191

Mono.. http://www.mono-project.com/FAQ:_General
 
Old 10-07-2008, 05:06 PM   #17
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
OK, So i think i got it. Mono let's you run your same program that you already compiled in windows, but run it in linux, untouched in many cases. Sometimes you need to make modifications to the program and recompile it to run.

Not sure if I just didn't ask the question properly in the previous posts, but that's what I wanted to find out. In fact, the mono website is rather vague on that as well. My program.exe that we currently just double click in windows can be opened from a linux command line by typing in: mono program.exe

Now a nice little issue:

when i run my "mono program.exe" from the command line, the program is suppossed to connect to a ms sql db on a win2k server on the local network.

I'm getting this nice error when the program tries to connect:

Error: system.data.sqlclient.sqlexception: sql server does not exist or access denied. and so on.


Any ideas to why it won't connect? Usually, this brings up a user and pass screen to get into the software.

-Thanks
 
Old 10-07-2008, 05:19 PM   #18
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
I'd take the error message at face value. Is your mysql server running and configured? Can you connect to it with "mysql -h hostname -u userid -p schema_name" ? "hostname" or "schema_name" might not be needed. Have you looked at the mono FAQs to see if there are any test cases you can run if you can't connect to your database server?
 
Old 10-07-2008, 05:25 PM   #19
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
It's a ms sql server running on msde, not a mysql server. Will that make a difference?
 
Old 10-07-2008, 05:36 PM   #20
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by xmrkite View Post
It's a ms sql server running on msde, not a mysql server. Will that make a difference?
I dunno. You're really going to have to either find someone with experience with mono (do they have a forum on their site?) or dig around in their FAQs and experiment. It's been a long time since I messed with MS stuff, and it was almost all in Oracle. I'm on the edge of risking pointing you in the wrong direction, and I don't want to do that. Sorry.
 
Old 10-07-2008, 07:20 PM   #21
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Is the linux box/env allowed to login to the sqlserver DB? In mysql, you define allowed users by name@ip ie a separate entry for each user on each client box.
Wildcards are also avail..
I know nothing about MS SQLServer..
 
Old 10-07-2008, 08:17 PM   #22
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Another bad memory returns:

IIRC, under MS SQL, there is some client/middleware that you have to configure to get you access to an SQL Server. Chances are there's something like that for mono.
 
Old 10-07-2008, 10:46 PM   #23
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
It also may depend on what type of authentication is configured for the MS SQL server..

if it's configured for Windows Domain authentication not sure how you would handle that..
http://www.acucorp.com/support/publi...ps/tips_36.php
 
Old 10-08-2008, 12:54 AM   #24
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
On slashdot.org there's an article about the latest ver of mono and how to get it to run .NET. Also how to run .NET in wine. Try these links:

http://tech.slashdot.org/article.pl?.../10/07/0051238

Quote:


Download winetricks [winehq.org] then run:

sh winetricks dotnet11 dotnet20

Bingo. .NET under wine.
winetricks: http://wiki.winehq.org/winetricks


Also
http://www.infoworld.com/article/08/...n_Linux_1.html

HTH
 
Old 10-08-2008, 11:17 AM   #25
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
OK, no windows domain needed, you can currently install the program on any win xp computer and it'll connect just fine to the db. There is an encrypted configuration file that we put in the program directory with the connection information.

I'll check out the links you guys posted today.

-Thanks
 
Old 10-08-2008, 04:32 PM   #26
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
ok, with wine, i am getting some nice errors, but with mono, i'm only getting a can't connect to sql db error. So i think i should try to get mono working since it seems farther along.

Here is the error i get now:

Quote:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
at Behemoth.frmLogin.domainLogin () [0x00000]
at Behemoth.frmLogin..ctor (System.Windows.Forms.Form fParent, System.Data.SqlClient.SqlConnection dbcSQL) [0x00000]
at (wrapper remoting-invoke-with-check) Behemoth.frmLogin:.ctor (System.Windows.Forms.Form,System.Data.SqlClient.SqlConnection)
at Behemoth.frmMain..ctor (System.Data.SqlClient.SqlConnection dbcSQL, System.String sSQLCon) [0x00000]
at (wrapper remoting-invoke-with-check) Behemoth.frmMain:.ctor (System.Data.SqlClient.SqlConnection,string)
at Behemoth.frmMain.Main () [0x00000]
So why can't it connect to the ms sql db?

Any ideas? Is there a way to test the db connection somehow? I mean, i know it works fine on the windows computers, but is there a way to test it from this linux box?
-Thanks
 
Old 10-08-2008, 07:08 PM   #27
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by xmrkite View Post
ok, with wine, i am getting some nice errors, but with mono, i'm only getting a can't connect to sql db error. So i think i should try to get mono working since it seems farther along.

Here is the error i get now:



So why can't it connect to the ms sql db?

Any ideas? Is there a way to test the db connection somehow? I mean, i know it works fine on the windows computers, but is there a way to test it from this linux box?
-Thanks
Have you checked the FAQs on the mono site? Have you done websearches on "linux mono System.Data.SqlClient.SqlConnection"? Have you considered joining the forum over on the mono site? http://www.go-mono.com/forums/

I found a hit while searching that might help you test your connection:

http://linux.die.net/man/1/sqlsharp
 
Old 10-11-2008, 02:19 AM   #28
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, again -

I haven't followed all the stuff that's been happening in this thread, but a couple of points that might help:

1. With regard to your original question "Can I run MSSQL on Linux?", the answer pretty much "no".

2. With regard to the separate question "Can I run a .Net client on Linux that talks to another, separate MSSQL server running on Windows?", the answer is very probably "yes".

3. MSSQL supports two modes of authentication: "SQL authentication" (where the username and password you use to connect to MSSQL are defined in MSSQL itself), and "Windows authentication" (where the user and password are defined externally, in Active Directory).

I suspect the grief you're experiencing now is that the connection might assume "Windows authentication".

This link might help:
http://www.mono-project.com/SQLClient

PS:
By all means, please try out QuakeBoy02's suggestion regarding "sqlsharp":
http://linux.die.net/man/1/sqlsharp

Last edited by paulsm4; 10-11-2008 at 02:20 AM.
 
Old 10-13-2008, 12:19 PM   #29
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
OK, i was able to connect to the sql server via the command line...but how do i get this program to use those settings? Currently, the program uses an encrypted config.ini file which is located in the same directory. Does the program itself have to be modified, or is there some sort of options i give mono when i run it?

So basically, i know the computer can connect to the ms sql db, but i need my program to connect now.

-Thanks
 
Old 10-13-2008, 12:37 PM   #30
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
From the looks of it , the program fails to connect and this results in the connection variable being passed a null value, which then causes a NullpointerException to be thrown. I am not familiar with .NET but it seems likely that the log-in code needs to be edited to work on Linux.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to MS SQL Server from linux C++ ? skosanba Linux - Software 0 08-14-2006 08:05 AM
Connect to ms sql server from linux RH saustin99 Linux - Newbie 1 02-17-2006 05:07 PM
Migrating from MS-SQL server to My-SQL emailssent Linux - Networking 2 02-07-2005 02:20 PM
setting up sql server on linux machine feetyouwell Linux - General 4 12-12-2004 10:58 AM
Will MS SQL run on a Linux box? cvonhelf Linux - Newbie 2 10-20-2003 02:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration