-
Notifications
You must be signed in to change notification settings - Fork 1
How to use
RAFAEL ANDRADE DA SILVA edited this page Sep 13, 2021
·
2 revisions
using QManagerOracle;
using QManagerOracle.Parameters;
async void teste()
{
SQLPlus sql = new SQLPlus();
SQLLdr ldr = new SQLLdr();
var paramsDB = new ParamsDB()
{
CriarNovaJanela = true,
IPAdress = "192.168.0.4",
PassDB = "1234"
};
await sql.ExecuteAsync(new ParamsScript()
{
Parameters = "",
ScriptDir = Environment.CurrentDirectory,
ScriptName = "criar_tabela.sql"
}, paramsDB);
await ldr.ExecuteAsync(new ParamsLoader()
{
DirWorkControl = Environment.CurrentDirectory,
FileUpload = "carga_teste.txt",
FileControl = "carga.ctl"
}, paramsDB);
}
private async void button1_Click(object sender, EventArgs e)
{
SQLPlus sql = new SQLPlus();
SQLLdr ldr = new SQLLdr();
sql.DebugEventParams += WriteRichText;
ldr.DebugEventParams += WriteRichText;
var paramsDB = new ParamsDB()
{
CriarNovaJanela = false,
IPAdress = "192.168.0.4",
PassDB = "1234"
};
await sql.ExecuteAsync(new ParamsScript()
{
Parameters = "",
ScriptDir = Environment.CurrentDirectory,
ScriptName = "criar_tabela.sql",
Debug = true
}, paramsDB);
await ldr.ExecuteAsync(new ParamsLoader()
{
DirWorkControl = Environment.CurrentDirectory,
FileUpload = "carga_teste.txt",
FileControl = "carga.ctl",
Debug = true
}, paramsDB);
}
private void WriteRichText(string result)
{
RichTextInvoke(result);
}
void RichTextInvoke(string texto)
{
if (InvokeRequired)
{
Invoke(new Action<string>(RichTextInvoke), new object[] { texto });
return;
}
richTextBox1.AppendText(texto);
}