Click here to Skip to main content
16,006,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Can VB.Net make a 32 bit console-based command line executable for Windows Pin
Eddy Vluggen14-Jan-09 3:26
professionalEddy Vluggen14-Jan-09 3:26 
QuestionHow can I get selected value from crystal report Pin
Ali 11013-Jan-09 20:02
Ali 11013-Jan-09 20:02 
AnswerRe: How can I get selected value from crystal report --> CROSS POST Pin
Tom Deketelaere13-Jan-09 22:01
professionalTom Deketelaere13-Jan-09 22:01 
AnswerMaybe use a Hyperlink Pin
David Mujica14-Jan-09 3:46
David Mujica14-Jan-09 3:46 
GeneralRe: Maybe use a Hyperlink Pin
Ali 11014-Jan-09 18:36
Ali 11014-Jan-09 18:36 
GeneralOn demand sub-report Pin
David Mujica15-Jan-09 3:13
David Mujica15-Jan-09 3:13 
GeneralRe: On demand sub-report Pin
Ali 11015-Jan-09 3:22
Ali 11015-Jan-09 3:22 
QuestionAbout the combobox textchange event Pin
drexler_kk13-Jan-09 17:07
drexler_kk13-Jan-09 17:07 
Dear all,

I'm new to this VB.NET,my platform using now to do the development is Visual Studio 2008 using the VB.NET 2008 Window Form to create a lorry transportation management system.

I'm facing problem with the combobox textchange event now. I'm using MySQL 5.0 with SQLYog v5.29 to develop this system.

The following is a form code for the user to insert the Delivery Order document:
Imports MySql.Data.MySqlClient

Public Class InputDO
    Public Shared MyConnString As String = "Server=;Database=logistic_sysdb;Uid=root;Pwd=;"
    Public Shared ObjMyConn As New MySqlConnection
    Public Shared ObjComm As New MySqlCommand
    Public Shared ObjRead As MySqlDataReader
    Public Shared SQL As String

    Dim ObjAdapter As MySqlDataAdapter
    Dim ds As DataSet
    Dim dt As DataTable
    Dim dt1 As DataTable

    Private Sub InputDO_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer

        ObjMyConn = New MySqlConnection(MyConnString)

        'Load the information into Lorry Number Combobox
        Try
            SQL = "SELECT * FROM lorry_detail"
            ds = New DataSet
            ObjAdapter = New MySqlDataAdapter(SQL, ObjMyConn)
            ObjAdapter.Fill(ds, "Lorry_Number")
            dt = ds.Tables("Lorry_Number")

            For i = 0 To dt.Rows.Count - 1
                ComboBox1.Items.Add(dt.Rows(i).Item(0))
            Next

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!")
        End Try

        Try
            SQL = "SELECT * FROM company_detail"

            ds = New DataSet
            ObjAdapter = New MySqlDataAdapter(SQL, ObjMyConn)
            ObjAdapter.Fill(ds, "Client_Company")
            dt1 = ds.Tables("Client_Company")

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!")

        End Try

    End Sub

    Private Sub ComboBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.TextChanged
        Dim x As String ' x = The Client Company name that stored at dt1
        Dim i As Integer

        x = ComboBox2.Text

        For i = 0 To dt1.Rows.Count - 1
            If x = dt1.Rows(i).Item(1) Then
                ComboBox2.Items.Add(dt1.Rows(i).Item(1))
            End If

        Next

    End Sub
End Class


I would like to show the similar Client company dropdown at the combobox while the user is typing the name of the company. I have select all the client company into dt1 from the database,and now how could I check if the user is typing each character into combobox2 will display the similar company name on the combobox?

Beside that,should I used a textbox or combobox for this event is better or any other ideas?

Hope someone can give me some help on this.

Thank you all for reading.
Regards
Drex
AnswerRe: About the combobox textchange event Pin
_mubashir14-Jan-09 21:42
_mubashir14-Jan-09 21:42 
QuestionRe: About the combobox textchange event Pin
drexler_kk15-Jan-09 0:01
drexler_kk15-Jan-09 0:01 
Questiondisable selection and context menu for a single column in datagrid view Pin
sohaib_a13-Jan-09 9:51
sohaib_a13-Jan-09 9:51 
AnswerRe: disable selection and context menu for a single column in datagrid view Pin
dan!sh 13-Jan-09 17:53
professional dan!sh 13-Jan-09 17:53 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
sohaib_a13-Jan-09 21:10
sohaib_a13-Jan-09 21:10 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
dan!sh 13-Jan-09 21:34
professional dan!sh 13-Jan-09 21:34 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
sohaib_a13-Jan-09 21:52
sohaib_a13-Jan-09 21:52 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
dan!sh 13-Jan-09 22:19
professional dan!sh 13-Jan-09 22:19 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
sohaib_a13-Jan-09 23:00
sohaib_a13-Jan-09 23:00 
GeneralRe: disable selection and context menu for a single column in datagrid view Pin
dan!sh 15-Jan-09 3:54
professional dan!sh 15-Jan-09 3:54 
QuestionHow to pass values to Unbound Fields? Pin
Historysheeter13-Jan-09 7:58
Historysheeter13-Jan-09 7:58 
AnswerRe: How to pass values to Unbound Fields? Pin
Dave Kreskowiak13-Jan-09 8:46
mveDave Kreskowiak13-Jan-09 8:46 
AnswerRe: How to pass values to Unbound Fields? Pin
programmervb.netc++14-Jan-09 2:58
programmervb.netc++14-Jan-09 2:58 
QuestionUnable to Upgrade Vb6 to Vb.net Pin
sarfarazaliqureshi13-Jan-09 6:44
sarfarazaliqureshi13-Jan-09 6:44 
AnswerRe: Unable to Upgrade Vb6 to Vb.net Pin
Henry Minute13-Jan-09 8:35
Henry Minute13-Jan-09 8:35 
GeneralRe: Unable to Upgrade Vb6 to Vb.net Pin
sarfarazaliqureshi13-Jan-09 9:00
sarfarazaliqureshi13-Jan-09 9:00 
GeneralRe: Unable to Upgrade Vb6 to Vb.net Pin
Henry Minute13-Jan-09 9:06
Henry Minute13-Jan-09 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.