Click here to Skip to main content
15,912,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I am creating a WEB SERVICE which i have to upload on a Linux server having MySQL as database on the web. The WEB SERVICE is used as as a reference in a WINDOW SERVICE.

I need to make a connection to MySQL db on the WEB SERVICE in order to fetch data from MySQL and according to an article on codeproject.com (Connecting to MySQL Database using C# and .NET[^]) a .Net library is to be installed in order to use the MySQL db in .Net. But as this WEB SERVICE will be located at the LINUX server; do i have to install this .Net library at Linux server also in order to make the WEB SERVICE connection to MySQL db work?

Thanks
Posted

I take it you're running Mono on the Linux server....and hosting a .Net web service?

If this is the case then yes - since the web service will be creating the data connection, it will require the MySQL.Net connextor assembly to be available on the Linux machine


Alternatively, you could create a non .Net web service in PHP or whatever and run that on the Linux machine & just have your .Net windows service consume the web service.
 
Share this answer
 
Comments
Varun Sareen 13-Sep-10 5:36am    
Hey Dylan, Thanks for such accurate answer. I tried the first option but i don't know why I am not able to connect the .Net Web Service to the MySQL database. Whenever I call a function that executes a SQL query i get this error: "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.DataException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
at executeOperations.executeScalar(String strSQLQuery)". Kindly help me resolving this error.

Thanks
Possibly try using IP address and specifying port in your connection string....e.g

C#
Server=192.168.1.1;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
 
Share this answer
 
Comments
Varun Sareen 14-Sep-10 1:05am    
Hey Dylan, thanks again for rapid reply. Well the above thing didn't solve my problem. Now the error is coming as: "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.DataException: Connection unexpectedly terminated". I think that there is some server side problem, may be a server level permission is to be granted for the server to accept requests from the .Net applications. what do you say on this dear friend.? Hoping again to get a solution from your end.

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900