0

I want to publish a lightswitch application to run with MySQL. I have created tables using lightswitch already.

I installed MySQL Connector for .Net

I can attach it as an externel datasource. But the MySQL option is not available when selecting the datasource in the publishing wizard.

Thank You

  • 1
    To my knowledge, Lightswitch cannot publish directly to MySQL. When you create tables in Lightswitch, they are created for SQL Server and can either be deployed to a LocalDB instance, or to full SQL Server or SQL Server Express. In order to use MySQL, you will have to create the tables in MySQL directly, and then link it to Lightswitch as an external datasource. Lightswitch can then use them as normal, but when you are publishing you will have to publish it yourself and setup the connection string to point to it. – RichardC Mar 07 '13 at 10:01
  • Thankyou for your reply. Can you tell me how to setup the connection string? it works on the developed computer but not on another computer. an error is shown saying "The server encountered an error processing the request. See server logs for more details". – Prabhath Karunakalage Mar 07 '13 at 13:59
  • 1
    Are you publishing to Desktop or Web? Have you installed the MySQL connector on the other computer? Is the MySQL database on a server or are you installing it on each computer? Does the other computer have a correct access method to the MySQL database (if it's on a server)? – RichardC Mar 07 '13 at 14:05
  • I am publishing to desktop. I had forgotten to install mysql connector. But after installing, when i try to save it says "An error occured while starting a transaction on the provider connection. See the inner exception for details". Also theres a line in the connections string which has the details of the computer i published in. Under the name "_IntrinsicData" – Prabhath Karunakalage Mar 08 '13 at 09:23
  • 1
    Sounds like you're publishing a Desktop 2-tier application, correct? You may want to check [this link](http://msdn.microsoft.com/en-us/library/vstudio/ff852056.aspx). While it doesn't specifically relate to MySQL, the section regarding the connection strings (steps 7-9) are what you need to pay attention to. As long as your connection string points to your MySQL database correctly, then all should work, and I'm guessing the issue is either in the syntax of your connection string, or in the actual connection between the computer you are running it on, and the computer where your data resides. – RichardC Mar 08 '13 at 10:38
  • 1
    Also, the "_IntrinsicData" connection string is (to my understanding) what Lightswitch uses for the security database. I'm not sure how you can put it in MySQL (as it's not something I have personally tried) but maybe try switching authentication off to see if the application then works. If so, your issue is getting the security database set-up in MySQL, rather than just your regular data. – RichardC Mar 08 '13 at 10:39
  • Thank you for the reply, the connection string points perfectly to my database. This program works with the same settings in the computer i developed the application on. But not on the other computer. I have installed the connector and tried switching off firewall too. I have installed mySQL server 5.1 seperately on both machines. – Prabhath Karunakalage Mar 08 '13 at 11:10
  • Hi I fixed it. Apparently you need to install a hotfix for this. After installation I restarted the pc and all seem to work fine now. Thank you very much for your help. – Prabhath Karunakalage Mar 08 '13 at 12:02
  • 1
    Glad you got sorted. Maybe you could put a link to the hotfix, so other users could find it if they come across this? – RichardC Mar 08 '13 at 12:15
  • 1
    Here it is http://archive.msdn.microsoft.com/KB2534087/Release/ProjectReleases.aspx?ReleaseId=5714 – Prabhath Karunakalage Mar 08 '13 at 13:54

0 Answers0