private void btnGenerateData_Click(object sender, EventArgs e) { this.CheckConnStringAssigned(() => { if (!CheckTableSetting()) { return; } string fileName = GetFullFileName(TableSetting.TableName, sqlFileExtensions); if (File.Exists(fileName)) { File.Delete(fileName); } try { TableSetting.Process(this.ConnStr); this.ShowMessage("表【{0}】SQL【{1}】生成成功!", TableSetting.TableName, fileName); } catch (Exception ex) { this.ShowMessage("表【{0}】SQL【{1}】生成失败:{2}!", TableSetting.TableName, fileName, ex.ToString()); } }); }