【问题标题】:VB Application connects to server fine on my computer but not on any other computerVB 应用程序在我的计算机上可以正常连接到服务器,但在任何其他计算机上都没有
【发布时间】:2012-10-17 03:16:02
【问题描述】:

我束手无策。我构建的应用程序可以在我的系统上完美运行,但不能在其他任何人上运行。这非常简单,在加载时它会向用户查询批号,然后过滤数据以在 datagridview 中仅显示具有该批号的项目。

这是我写的代码:

'*******************************************************************************************************************************
' When the form loads, the following code opens a inputbox that asks the user for a batch number. This number then gets used
' to filter the data before populating the DataGridView
'*******************************************************************************************************************************
Private Sub frmAQFilter_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Me.DataTable1TableAdapter.Fill(Me.ElementDataset.qryAQFilterData)

    Dim blnX As Boolean = True
    Dim msg As Integer

    Do While blnX
        strBatch = ""
        strBatch = InputBox("Batch Number: ")

        If Len(strBatch) > 0 Then
            DataTable1BindingSource.Filter = String.Format("Batch = '" & strBatch & "'")
            If Not DataTable1BindingSource.Count > 0 Then
                msg = MsgBox("No records found with the batch number: " + strBatch + Chr(13) _
                             + "Do you wish to enter a different batch number", MsgBoxStyle.YesNo)
                If msg = vbNo Then
                    Me.Close()
                    blnX = False
                End If
            Else
                blnX = False
            End If
        Else
            Me.Close()
            blnX = False
        End If
    Loop
    Me.WindowState = FormWindowState.Normal
End Sub

我没有收到任何错误,只是没有填充数据集。我的第一个想法是连接字符串不好。那里没有问题。任何建议将不胜感激。

谢谢。

【问题讨论】:

  • 别人的机器上是否也安装了Sql Server 2008和所需的数据库??
  • 我测试应用程序的所有计算机都安装了 SQL Server 2008 和 Visual Studio 2010。他们也有和我一样的服务器连接。
  • 您使用的是 SQL 的 express 版本吗?我认为那个版本只允许本地访问,默认禁用网络访问。
  • 我们都在使用 SQL Server 2008 R2
  • 我不知道这是否重要,但我还应该补充一点,vb 项目保存在数据库所在的同一台服务器上,但我只能在我的电脑上让它工作.

标签: vb.net visual-studio-2010 visual-studio sql-server-2008


【解决方案1】:

禁用防火墙。还要尝试在 vb.net 中设置 SQL 服务器的网络地址,以便为两个客户端使用单个外部 SQL 服务器。我认为这将有助于我们知道在哪里进行调查。

【讨论】:

    【解决方案2】:

    感谢您尝试帮助我解决此问题。事实证明,问题不是我的代码。在我的计算机上安装 Visual Studio 时,它安装不正确,导致它生成损坏的 64 位版本而不是 32 位版本。非常恼火,但问题已得到纠正。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-28
      • 2020-11-26
      • 2019-08-22
      • 2020-06-07
      • 2019-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多