如何发布一个Vb.net应用程序与crystall报告,而无需客户端安装visual studio

0md85ypi  于 2022-12-19  发布在  .NET
关注(0)|答案(2)|浏览(143)

我的应用程序项目有问题,我决定将我的VB. Net应用程序设置为exe文件,这样我就可以告诉客户端在他们的设备中设置我的应用程序,并连接到我的PC以获得数据库(Xampp Mysql)。我不想让客户端安装MySQL ODBC驱动程序,Crystal Report和Visual Studio,而他们只需要设置我的exe文件。
实际上,我已经让客户端连接到数据库,但是因为我的应用程序上有一个crystal report,所以它变得更加复杂。
我的工具:

  • 可视化工作室2022
  • VS 64位的安装程序项目
  • VS 2022 64位的水晶报表
  • 桑普
  • 数据源64位和32位
  • 我的sql驱动程序64位和32位

这是处理数据库连接的模块,我在Xampp中使用mysql,并且为了连接它,我使用Mysql ODBC驱动程序64位:
'

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

'
这是当我在客户端(不带vs 2022和不带Crystal Report)unexpected Result中运行时,这是我的预期结果,我的设备(服务器vs 2022、Xampp、Crystal Report等)POV:expected result

hts6caw3

hts6caw31#

在用户计算机上安装Crystal运行时(不需要Visual Studio)。
请确保部署运行库时使用的Service Pack级别与CR for VS的Service Pack级别匹配。

jk9hmnmh

jk9hmnmh2#

下载内容如下:https://origin.softwaredownloads.sap.com/public/site/index.html
确保选择Runtime(在绿色框中)--而不是Cr for VS(在红色框中)。
请确保使用与Visual Studio中的项目中使用的SP级别相同的SP级别。
确保使用与项目中的编译目标相同的32/64位选项。

相关问题