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

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -