abhit_kumar
Member
- Joined
- Aug 13, 2008
- Messages
- 19
- Programming Experience
- Beginner
Dear Expert,
I have made taken one textbox in form, in which i have written following logic in Got Focus event.
When i focus on that its automatically showing all the suggested name from database field.
CODE:-
I want that if suppose, i will type some other name which is not exist in autocomplete string collection then its should gives error.
Please guide me.
Regards,
AKM
I have made taken one textbox in form, in which i have written following logic in Got Focus event.
When i focus on that its automatically showing all the suggested name from database field.
CODE:-
VB.NET:
Private Sub CustomerName_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CustomerName.GotFocus
da = New SqlDataAdapter("Select CustomerName from CustomerMaster", myConnection)
da.Fill(ds, "CustomerMaster")
Dim acFirstName As New AutoCompleteStringCollection
For Each dr As DataRow In Me.ds.Tables("CustomerMaster").Rows
acFirstName.Add(dr.Item("CustomerName").ToString)
Next
CustomerName.AutoCompleteCustomSource = acFirstName
End Sub
I want that if suppose, i will type some other name which is not exist in autocomplete string collection then its should gives error.
Please guide me.
Regards,
AKM