a Sample implementation of write SQL scripts using the task monitor
Description
ICSSoft.Services.ChangesToSqlBTMonitor
is a kind task monitor, which allows you to record SQL-scripts change the data.
the service Connection
To connect this service, you need in the configuration file to write:
<add key="BusinessTaskMonitorType" value="ICSSoft.Services.ChangesToSqlBTMonitor, ChangesToSqlBTMonitor, Version=1.0.0.1, Culture=neutral, PublicKeyToken=e5ad39f116a43e0b"/>
use of the service
Example handlers for menu items:
private void RecorderClearClick(object sender, EventArgs e)
{
ICSSoft.Services.ChangesToSqlBTMonitor.Clear();
}
private void RecorderSaveClick(object sender, EventArgs e)
{
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
string fileName = saveFileDialog.FileName;
StreamWriter writer = new StreamWriter(fileName, false, Encoding.UTF8);
// Have the writer write strings to the store.
writer.Write(ICSSoft.Services.ChangesToSqlBTMonitor.Record);
writer.Close();
}
}
So in the output script to avoid unnecessary queries, you can configure a filter on the table names in the configuration file
<add key="ChangesToSqlExcept" value="AuditSystem,STORMSETTINGS,Audiopiracy,Auditionee"/>