我正在开发一个小型应用程序,一切都很好,希望在我想要获取数据或刷新数据网格时:
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
ProfesorBLL p;
IEnumerable<Profesor> list;
public MainWindow()
{
InitializeComponent();
Lista();
}
public async void List()
{
p = new ProfesorBLL();
list = await p.KtheListen();
dtg.ItemsSource = list;
}
private void btnShto_Click(object sender, EventArgs e)
{
var form = new shto();
form.Handler += FormaHANDLE;
form.Show();
}
private void FormaHANDLE(object sender, EventArgs e)
{
dtg.ItemsSource = Typeof(List<Profesor>);
List();
}
private void btnshow_Click(object sender, EventArgs e)
{
var total = "";
foreach (var item in list)
{
total += item.showfullna() + "\n";
}
MessageBox.Show(total);
}
}
}
错误故障:错误1无法将类型'System.Type'隐式转换为'System.Collections.IEnumerable'。存在显式转换(您是否缺少演员表?)
在我错了的地方,有人可以帮助我,因为我是新来的,而在我做错的地方没有得到帮助吗?