Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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..
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.
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.
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
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:
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".
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.