DataClasses1DataContext MyCountry = new DataClasses1DataContext("Data source=.;
User ID=sa; Password=; Integrated security=true; Initial catalog=training;");
var _MyCountry = from cntry in MyCountry.GetTable<country>() select cntry;
grd_table.DataSource = _MyCountry;
當我嘗試綁定grd_table
中的國家時。它顯示錯誤:DataGrid中的問題
System.Windows.Controls.DataGrid' does not contain a definition for 'DataSource'
and no extension method 'DataSource' accepting a first argument of
type 'System.Windows.Controls.DataGrid' could be
found (are you missing a using directive or an assembly reference?)"**.
我應該怎麼做才能解決這個錯誤。
您是否真的不在乎在MSDN/docs中查找數據網格的屬性? – basti