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
. 它显示错误:
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?)"**.
我应该怎么做才能解决这个错误。