I have a table and some of that columns i need to take it to my dropdown list.and i need to show that values in dropdown list also.In my idea i get that column name to the dropdownlist Text field and that numbers to the dropdown list value filed.
My Dropdown i need to looks like this.(this is for userId 100)<br>

My Table.

This is Oracle database and i tried to get it both text and value looks like this.. but unfortunately.. i cant get the value.( eg.. if Volvo has 3 ).
In here using below query i can get that Column names,But i need both column names and respective values.
My Code
public List\<AllocModel> GetAllocationByUserId(string UserId)
{
try
{
DatabaseProviderFactory factory = new DatabaseProviderFactory();
Database db = factory.Create("DefaultCon");
con.Open();
string Query = @"SELECT column\_name
FROM USER\_TAB\_COLUMNS
WHERE table\_name = 'TBL\_ALLOC' AND column\_name LIKE 'EZ\_%'";
// string Query = @"SELECT column\_name
// FROM USER\_TAB\_COLUMNS T ,TBL\_ALLOC TX
// WHERE T.table\_name = 'TBL\_ALLOC' AND T.column\_name LIKE 'EZ\_%' AND (TX.UserId =: TX.UserId)";
cmd = db.GetSqlStringCommand(Query);
// db.AddInParameter(cmd, "TX.UserId", DbType.String, UserId);
var dx = db.ExecuteDataSet(cmd);
var dd = dx.Tables\[0\].AsEnumerable().Select(x => new AllocModel
{
COLUMN\_NAME = x.Field\<string>("COLUMN\_NAME") // Column names comes to here.
});
var allocNos = dd.ToList();
return allocNos;
}
catch (Exception ex)
{
throw;
}
}