thanks for reply but i got error indexoutofrange exception was unhandled..
here is my code....
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
con.Open()
Dim cmd As New SqlCommand("select cus_id,cus_type from customer where cus_name= @cus_name ", con)
With cmd.Parameters.Add(New SqlParameter("@cus_name", Me.nametxt.Text))
End With
dr = cmd.ExecuteReader()
If (dr.HasRows) Then
dr.Read()
idcombo.Items.Add(dr("0"))
custype = dr("cus_type").ToString()
If custype = "A" Then
tenlt.Visible = True
tenlt.Checked = True
ElseIf custype = "B" Then
twentylt.Visible = True
twentylt.Checked = True
ElseIf custype = "C" Then
twentyfivelt.Visible = True
twentyfivelt.Checked = True
End If
End If
dr.Close()
con.Close()