0

hello every one
this my code to fill my combobox with the name of clients and i but the connection string in a module to let my prog workimg in any pc in the group But the problem here in the combobox says can not make the connection, I know that because of i did not wriet the connection string in the form and I do not wont to add the connection string on the form what is the solution?

con.Open()
            cmd.Connection = con
            ds = New DataSet
            tables = ds.Tables
            da = New SqlDataAdapter("SELECT custnam from client", con)
            da.Fill(ds, "client")
            Dim view1 As New DataView(tables(0))
            With ComboBox1
                .DataSource = ds.Tables("client")
                .DisplayMember = "custnam"
                .ValueMember = "custnam"
                .SelectedIndex = -1
                .AutoCompleteMode = AutoCompleteMode.SuggestAppend
                .AutoCompleteSource = AutoCompleteSource.ListItems
                con.Close()
            End With
2
Contributors
1
Reply
12
Views
1 Year
Discussion Span
Last Post by tinstaafl
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.