score:8

Accepted answer
repeater rpt;

rpt.datasource = new[] { new { id = 10 } };
rpt.databind();

score:0

not really. you could write it like this if you prefer:

var q = new[] { 10 }.select(t => new { id = t });
rpt.datasource = q;
rpt.databind();

score:0

it doesn't get much simpler than that.

you could inline the variable, so that it becomes:

repeater rpt = ...;

rpt.datasource = from t in new[] { 10 }
                 select new { id = t };
rpt.databind();

Related Query

More Query from same tag