Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-09-2011, 09:34 AM   PM User | #1
nirajmchauhan
New Coder

 
Join Date: Sep 2010
Location: India
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
nirajmchauhan is an unknown quantity at this point
Smile vb.net combobox help

Hello everyone,
I am having a vb.net 2008 form, in it I have added a combo-box, with autocomplete property and filled it with sql database,

It works fine,
but a user runs the program and types in combo box for auto-complete the he able type something which is not in database,
I want to avoid that,
he should be only able to write which is inside the database field, if he types something which is not in database and leaves the combo-box then an error message should be displayed,
I tried code in text changed event of combo box, but if I change the normal combo-box field then too it displays error
here is my code:

Code:
Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
        If ComboBox1.Text = DataSet1.Tables("bill").Columns("item").ToString Then

        Else
            MsgBox("error")
        End If
    End Sub
Any help will be appreciated
nirajmchauhan is offline   Reply With Quote
Reply

Bookmarks

Tags
combo-box, vb.net

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:42 PM.


Advertisement
Log in to turn off these ads.