Hi,
I am trying to create an eventlog DLL which uses vistaDB but I have a
problem calling it.. can you please help...
the DLL:
using System;
using VistaDB;
namespace eventlogDLL
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class eventlog
{
public eventlog()
{
//
// TODO: Add constructor logic here
//
}
public void addlog(string log_app, string log_description, string
log_user, string log_ip, string log_os, string log_computer)
{
// Database;
VistaDBDatabase logDatabase = new VistaDBDatabase();
VistaDBTable logTable = new VistaDBTable();
// Database File;
// string strDatabase =
Path.GetDirectoryName(Application.ExecutablePath) +
"\\Database\\eventlog.vdb";
string strDatabase = "C:\\Documents and Settings\\Jassim Rahma\\My
Documents\\Visual Studio Projects\\Ezi-Work\\Database\\eventlog.vdb";
// connect to database;
logDatabase.DatabaseName = strDatabase;
logDatabase.Cypher = CypherType.Blowfish;
logDatabase.Password = "17218881";
logDatabase.Parameters = 0;
logDatabase.Exclusive = true;
logDatabase.Connect();
// open proposal age tables;
logTable.Database = logDatabase;
logTable.TableName = "EVENT_LOG";
logTable.Open();
// add new eventlog;
logTable.Insert();
logTable.PutString("EZI_NAME", log_app);
logTable.PutMemo("HIGHEST_SUM_INSURED", log_description);
logTable.PutString("EZI_REMARKS", log_user);
logTable.PutString("CREATED_BY_USER", log_ip);
logTable.PutString("CREATED_BY_USER", log_os);
logTable.PutString("CREATED_BY_COMPUTER", log_computer);
logTable.PutDateTime("CREATED_BY_DATE", DateTime.Now);
logTable.Post();
//Close table
logTable.Close();
//Close database
logDatabase.Close();
}
}
}
and calling it:
using eventlogDLL;
eventlog EventLog = new eventlog();
eventlog.addlog("Ezi-Life", "New Ezi-Life Record was added", "jrahma",
"192.168.250.11", "Windows XP", "JASIM");
Many Thanks,
Jassim Rahma
*** Sent via Developersdex http://www.developersdex.com ***