I have a combo box that's filled from a query in the database. If I add a field to the database, the new field won't show up in the form until I close it and reopen it.
So, how do I refresh the contents of that combo box?
I bound the data onto the combo box like this:
I tried copying the same code to the cmbAuthor's Click event, and it gave me this error:Code:dbConn.Open() dbAdpBook = New SqlClient.SqlDataAdapter("SELECT * FROM Publisher", dbConn) dbDsetBook = New DataSet dbAdpBook.Fill(dbDsetBook, "Publisher") dbConn.Close() If dbDsetBook.Tables("Publisher").Rows.Count > 0 Then With cmbAuthor .DisplayMember = "PublisherName" .ValueMember = "PublisherID" .DataSource = dbDsetBook.Tables("Publisher") End With End If
Cannot bind to the new value member. Parameter name: value
and points to the .ValueMember = "PublisherID" line of code.




Reply With Quote