I'm trying to create VB.Net app with crystal reports and MySQL as the database. I tried connecting Crystal report and MySQL database through various available methods but only DSN method got successful(Partially).
I have created a 64bit System DSN and linked that to crystal report in VB.Net 2022. In the design view, I can see the report with data.
However, when I try to run and view the report, following happens.
I also set the logon credentials at the run time using following code.
Dim rep As New crRepAllBooks
rep.SetDatabaseLogon("root", "xxxxxxxxx", "localhost", "lms")
CrystalReportViewer1.ReportSource = rep
rep.Refresh()
I also tested it with a 32bit DSN with same results. I'm using any CPU option.
Can some one kindly explain me how to do this properly without getting the prompt to enter credentials.
You are probably not building the application in Release mode as a 64-bit application.
You stated that you created a 64-bit DSN, and Visual Studio is running as a 64-bit application, so everything works fine in the debugger.
However, if you don't specify to build the .EXE in 64-bit mode, you may end up with a 32-bit executable trying to use the 64-bit DSN, which won't work.
You'll either have to specify Release mode to build a 64-bit application, or also create a 32-bit DSN.