在 DisplayMember 和 ValueMember 的组合框中调用数据库值,但 ValueMember 属性在这里不起作用......
sql = "select NAME_DESC,ACCOUNT_CODE from ACCOUNT_CONTROLS ORDER by
NAME_DESC"
cmd = New OracleCommand(sql, sgcnn)
adapter.SelectCommand = cmd
adapter.Fill(ds)
adapter.Dispose()
cmd.Dispose()
CmbConAcc.DataSource = ds.Tables(0)
CmbConAcc.DisplayMember = "NAME_DESC"
CmbConAcc.ValueMember = "ACCOUNT_CODE"
--- 尝试将 ValueMember 数据插入数据库
暗淡 cmd As OracleCommand = New OracleCommand()
cmd.CommandText = "INSERT INTO ACCOUNT_HEADS (HEAD_CODE,NAME_DESC,ACCOUNT_CODE,REMARKS)" &
"values( trim(" & TxtAccCode.Text & "),trim(' " & TxtNDesc.Text & " '),trim(' " & CmbConAcc.ValueMember & " '),trim(' " &
txtRemarks.Text & " ')) "