vb.net - concatenate Combobox items from Oracle DB -


i want display 2 table values oracle db in combobox (name , surname). far can display one, , 1 doesn't work criteria.

 using conn oracleconnection = new oracleconnection("data source=mydb;user id=lucky;password=mypassword;")              try                  conn.open()                  dim sql string                 niz = "select name,surname mytable id=1 "                 dim cmd new oraclecommand(sql, conn)                 cmd.commandtype = commandtype.text                  dim dr oracledatareader = cmd.executereader()                  while (dr.read())                     cmbcustomers.items.add(dr.getstring(0))                 end while                  conn.close()              catch ex exception                 messagebox.show(ex.message)                             conn.dispose()             end try 

anybody knows how display name , surname in combobox, clause ?

try using string concatenation way

 select name ||' ' || surname mytable id=1 

if need alignment can try padding

 select name || rpad(' ', (12 - length(name),' ') ||  '-  ' || surname mytable id=1 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -