假设您正在使用数据表,您可以执行以下操作:private async void btnSearch_Click(object sender, EventArgs e) // async is important{ DataTable dt = await Task.Run(() => // await is important (avoids the UI freeze) { return GetData(); // Fetch your data from DB }); // Fill your listbox with the data in dt}