私は私の知恵の終わりにいます。私が作成したアプリケーションは、私のシステムでは完全に機能しますが、他の人では機能しません。非常に簡単です。ロード時にバッチ番号をユーザーに照会し、データをフィルタリングして、データグリッドビューにそのバッチ番号を持つアイテムのみを表示します。
これが私が書いたコードです:
'*******************************************************************************************************************************
' 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
エラーは発生しません。データセットにデータが入力されないだけです。私が最初に思ったのは、接続文字列が悪いということでした。そこに問題はありません。アドバイスをいただければ幸いです。
ありがとうございました。