Home > Software design >  How to publish a Vb.net application with crystall report, without client install the visual studio
How to publish a Vb.net application with crystall report, without client install the visual studio

Time:12-14

I've problem with my application project, I decide to setup my VB.Net application to exe file so I can just tell the client to setup my application in their device and connect to my PC to get the database (Xampp Mysql). I don't want to make client install the MySQL ODBC Driver, Crystal Report,and Visual Studio instead they just need to setup my exe file.

actually I already make the client connect to the database, but because my application have a crystal report on it, it's making more complicated.

My tool:

  • Visual Studio 2022
  • Installer Project for VS 64 bit
  • Crystal Report for VS 2022 64 bit
  • Xampp
  • Odbc Data sources 64 bit and 32 bit
  • my sql driver 64 bit and 32 bit

this is the module that will process the database connection, I use mysql in Xampp, and to connect it I use Mysql ODBC Driver 64 bit :

`

Imports System.Data.Odbc
Imports System.Text
Imports System.Security.Cryptography
Module Module1
    Public Conn As OdbcConnection
    Public da As OdbcDataAdapter
    Public ds As DataSet
    Public rd As OdbcDataReader
    Public rd2 As OdbcDataReader
    Public cmd As OdbcCommand
    Public cLevelUser, cUserId, mPath, cNamaUser, cId_Dataset, cKode_Prodi, cId_Periode As String
    Public tblEdit, Valid As Boolean
    Public Sub Koneksi()
        'Procedure koneksi database dengan MySql
        mPath = Application.StartupPath & "\"
        Try
            Conn = New OdbcConnection("DSN=dsnMahasiswa_Regis;MultipleActiveResultSets=True")
            If Conn.State = ConnectionState.Closed Then
                Conn.Open()
            End If
        Catch ex As Exception
            MsgBox("Koneksi Database Gagal", vbExclamation, "Koneksi Gagal")
        End Try
    End Sub
    Public Function StripNonAlphaNum(ByRef sText As String) As String
        Dim strRegex As String = "[^a-zA-Z0-9 -]"
        Dim rgx As New System.Text.RegularExpressions.Regex(strRegex)
        Return rgx.Replace(sText, "")
    End Function
    Public Function SHA256(ByVal Content As String) As String
        'Function untuk mengenkrip password dengan algoritma SHA256
        Dim MoleCul3 As New Security.Cryptography.SHA256CryptoServiceProvider
        Dim ByteString() As Byte = System.Text.Encoding.ASCII.GetBytes(Content)
        ByteString = MoleCul3.ComputeHash(ByteString)
        Dim FinalString As String = Nothing
        For Each bt As Byte In ByteString
            FinalString &= bt.ToString("x2")
        Next
        Return FinalString
    End Function
End Module

`

this is when I run in Client (without Vs 2022 and without Crystal Report) enter image description here

  • Related