Hi!
I'm updateing my DB via an OleDbDataAdapter:Currently I have some DataGridViewComboBoxColumns with DataSource set to a DataTable read from database, withCode:insertCommand = New OleDbCommand("INSERT INTO bundle (num, document_id, .....) " & _ "VALUES (@num, @document_id, .... )", conn) insertCommand.Parameters.Add("@num", OleDbType.Integer, 4, "num") insertCommand.Parameters.Add( "@document_id", OleDbType.Integer, 4, "document_id")
How can I achieve something like this in pseudo code:Code:myBindingSource.DataSource = "store_id" With myComboBoxColumn .DataSource = alternativesDataTable 'filled from a separate table in the database .DataPropertyName = myBindingSource.DataSource() .DisplayMember = "title" .ValueMember = "id" .HeaderText = "MyColumn" End With
I cannot change the valueMember to be "title", as some titles contain percentage sign(%), which causes an error.Code:insertCommand.Parameters.Add("@sortiment", OleDbType.VarChar, 20, "store_id"->DisplayMember )




Reply With Quote