For example
Drag and Drop one GridView control, one Button control, one label control and
one DropDownList control on the form.
ASPX code
<div >
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None">
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<br />
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>rohatash</asp:ListItem>
<asp:ListItem>andrew</asp:ListItem>
<asp:ListItem>yardi</asp:ListItem>
<asp:ListItem>Rahul</asp:ListItem>
<asp:ListItem>monu</asp:ListItem>
</asp:DropDownList>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="ShowRecord"
Height="37px" />
</div>
Now double click on the Button Control and add the following code.
Protected Sub Button1_Click(ByVal
sender As Object,
ByVal e As EventArgs) Handles
Button1.Click
Dim str As String = "Data
Source=.;uid=sa;pwd=Password$2;database=dropdowndatabase"
Dim con As New SqlConnection(str)
con.Open()
Dim cmd As New SqlCommand("select
* from info where username = '" + DropDownList1.SelectedItem.Text +
"'", con)
'Dim cmd As New SqlCommand("select * from info")
Dim Adpt As New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
If (Adpt.Fill(ds,
"info")) Then
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
Label1.Text =
"Found"
GridView1.Visible = True
Else
Label1.Text =
"Not found"
GridView1.Visible = False
End If
End Sub
Now run the application.

Figure1.
Now select username from dropdownlist and click on the ShowRecord Button.

Figure2
Now select an item from the DropDownList which is not in database. GridView will
be invisible for that selected item.
Figure3