Tuesday, 15 September 2015

c# - displaying database column data horizontally -



c# - displaying database column data horizontally -

this question has reply here:

how display rows columns in datagridview? 1 reply

i have scenario in have show info of each table field horizontally.

id 1 2 3 4 5 name 'ahmad' 'umar' 'nadeem' 'raza' 'saquib' city 'new york' 'paris' 'london' 'new york' 'london'

can tell me how can done in asp.net c#?

something that:

class programme { static void main(string[] args) { humandto humandto = new humandto(); list<human> humans = new list<human>(); humans.add(new human(){city = "london", id = 1}); humans.add(new human() { city = "london2", id = 2 }); humans.add(new human() { city = "london3", id = 3 }); humans.add(new human() { city = "london4", id = 4 }); humans.foreach(e => humandto.add(e.city, e.id)); } } public class human { public int32 id { get; set; } public string city { get; set; } } public class humandto { public list<int32> ids { get; set; } public list<string> cities { get; set; } public humandto() { ids = new list<int>(); cities = new list<string>(); } public void add(string city, int32 id) { ids.add(id); cities.add(city); } }

c# asp.net sql

No comments:

Post a Comment