0

私はWPFが初めてです。ユーザーがデータベースをtxtファイルとしてエクスポートできるWPFアプリケーションがあります。データベースには固定数の列がありますが、行は制限されていません。私の問題は次のとおりです。

  1. 複数のtxtファイルをインポートする必要があり、それらを上下に追加する必要があります。

  2. すべてのファイルがインポートされた後、インポートされたデータに対してクエリ (sql) を作成する必要があります。

1つのtxtファイルをインポートするこのコードを使用しました(ただし、それ以上のファイルをインポートする必要があります)が、データを検索できません..

Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) 'Create OpenFileDialog Dim dlg As Microsoft.Win32.OpenFileDialog = New Microsoft.Win32.OpenFileDialog()

    ' Set filter for file extension and default file extension 
    dlg.DefaultExt = ".txt"
    dlg.Filter = "Text documents (.txt)|*.txt"

    ' Display OpenFileDialog by calling ShowDialog method 
    If (dlg.ShowDialog() = True) Then

        '; Open document 
        Dim filename As String = dlg.FileName
        FileNameTextBox.Text = filename

        Dim paragraph As Paragraph = New Paragraph()
        paragraph.Inlines.Add(System.IO.File.ReadAllText(filename))
        Dim document As FlowDocument = New FlowDocument(paragraph)
        FlowDocReader.Document = document
    End If

End Sub

どうも :)

4

0 に答える 0