i hav a small query,,,i have made a windows application,i m using listview in which i want to display all the table names in my database on a click of a button,,,how can i do tht...
tnks in adv

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If conn.State = ConnectionState.Closed Then
            conn.Open()
        End If

        Dim str10 = "sp_tables"
        cmd = New SqlCommand(str10, conn)
        dr = cmd.ExecuteReader
        Do While dr.Read
            ListView1.Items.Add(dr("TABLE_NAME"))
        Loop
        'If dr.Read Then
        '    ListView1.Items.Add(dr("TABLE_NAME"))
        '    'ListView1.Items.Add(dr(1))
        'End If
        dr.Close()
        conn.Close()
    End Sub

well i am using this code,it gives me the table names but the prob is that along the table names it gives me the names of other views and other names,,i only want

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.