日期:2014-05-18 浏览次数:20772 次
public DataTable ReturnDataTable(string cmdText) { frmWait frmW = new frmWait(); frmW.Show(); try { wcfHost = new ServiceReference1.Service1Client(); DataTable dt = wcfHost.ReturnDataTable(cmdText); return dt; frmW.Close(); } catch { frmW.Close(); MessageBox.Show("请检查与服务器的连接是否正常!", "获取数据失败", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } finally { DisposeWcfHost(wcfHost); } }