更新时间:2022-06-20 23:45:14
你可以'除了从创建它们的线程(UI线程)访问控件。
为了做到这一点,你必须使用P / Invoke:
You can''t access controls except from the thread on which they were created (the UI thread).
In order to do it you must use P/Invoke:
Invoke(new MethodInvoker(delegate { DataGridView1.datasource=Connection.runselect(sqlStatment); }));