تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] ماهو الخطأ في هذا الكود ؟؟
#2
سلام

جرب هدا التعديل
كود :
Public Class Form2

    Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click
        Try

            Using DataAdapter1 As New OleDb.OleDbDataAdapter("SELECT * FROM [In_Work] WHERE [Name_Stuff]='" & txtBuildingName.Text.Trim & "'", ConnDB)
                Using DataTable1 As New DataTable
                    For Each row As DataRow In DataTable1.Rows
                        lstViewSearch.Items.Add(New ListViewItem(New String() {row("ID"), row("Name_Stuff"), row("Time_In"), row("Way_Late")}))
                    Next
                End Using
            End Using

            Using DataAdapter1 As New OleDb.OleDbDataAdapter("SELECT * FROM [Out_Work] WHERE [Name_Stuff]='" & txtBuildingName.Text.Trim & "'", ConnDB)
                Using DataTable1 As New DataTable
                    For Each row As DataRow In DataTable1.Rows
                        lstViewSearch.Items.Add(New ListViewItem(New String() {row("ID"), row("Name_Stuff"), row("Time_Out"), row("Way_Late")}))
                    Next
                End Using
            End Using

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

End Class


موفقين
متغيب
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
RE: ماهو الخطأ في هذا الكود ؟؟ - بواسطة الطالب - 04-06-15, 07:55 PM


التنقل السريع :


يقوم بقرائة الموضوع: