0
我写的LINQ简单的查询到SQL:
如何在c#中的公共范围声明var数据类型?
var query = (from p in behzad.GAPERTitles
select new
{
p.id,
p.gaptitle
}).ToArray();
了代码到C#Windows应用程序,windows窗体加载事件,我想用起来效果到按钮单击事件在此范围内:
private void button1_Click(object sender, EventArgs e)
{
//using var query array in this scope for example string temp=query[i].id
}
我该如何解决呢?