problem in DLL calling

J

Jassim Rahma

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
 
C

Chris Dunaway

Jassim said:
I am trying to create an eventlog DLL which uses vistaDB but I have a
problem calling it.. can you please help...

What is the problem?
 
J

Jassim Rahma

actually that's my question... I have created the DLL and trying to call
it.. what's wrong with my code?


it seems that this line is not recognized:

using eventlogDLL;

eventlog.addlog("Ezi-Life", "New Ezi-Life Record was added", "jrahma",
"192.168.250.11", "Windows XP", "JASIM");



Many Thanks,
Jassim Rahma
 
J

Jassim Rahma

I have already added a reference to the DLL using

Project->Add Reference.



Many Thanks,
Jassim Rahma
 
C

Chris Dunaway

Jassim said:
it seems that this line is not recognized:

using eventlogDLL;

What is the error message you are getting? Have you compiled the .dll?
Is the .dll project part of your solution? Have you tried a project
reference?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top