str = "select sno,name,city from employees"
dt = GetTable(str)

Public Function GetTable(ByVal mstr As String)
cmd = New SqlClient.SqlCommand(mstr, con)
da = New SqlClient.SqlDataAdapter(cmd)
dt = New DataTable
da.Fill(dt)
Return (dt)
End Function


How to display three columns sno,name and city in combobox

Please help

You can't do that with the standard .NET combobox. You could owner draw it or you could download a custom control with that feature like this one.(or create one yourself) Or you could just junk the combobox for a listview or datagridview.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.