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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -