c# - issue in DataGrid when load the items -
i tried load top3 record of table datagrid shows error cannot implicitly convert type 'system.linq.iqueryable' 'string'.the code below wrote
mydatatbasedatacontext mydb = new mydatatbasedatacontext(); var top3 = (from t in mydb.gettable<student>() select t).take(2); grd_8.itemstringformat = top3;
change var top3 = (from t in mydb.gettable<student>() select t).take(2);
to
list<student> top3 = (from t in mydb.gettable<student>() select t).take(2).tolist();
and if grd_8.itemstringformat string have convert yr list string using stringbuilder
but can assign list<student> top3
grid itemssource/datasource
Comments
Post a Comment