|
|
Hi,
I am trying to create an eventlog DLL which uses vistaDB but I have a
problem calling it.. can you please help...
I have created the DLL but I don't know what is the problem in calling it?!
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");
Best Regards,
Jassim Rahma
|
|
|
|
|
What is the problem then?
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
Can anyone guide me on development of setup and deployment projects in .net or any other windows installer tool?
Please help at the earliest.Any help would be appreciated.
Regards,
Lata Agrawal
|
|
|
|
|
|
I want to make some variables contstant.
This is the important part of the code:
namespace NiklasUlvinge.ChipsEater
{
abstract class Item
{
...
protected Brush surf = Brushes.LightGray;
protected Pen side = Pens.DarkGray;
protected Pen loff = Pens.Black;
protected Pen lon = Pens.Red;
...
}
...
}
I want child's to Item to be able ot accsess those pens, and it would be better if they where constant.
If I make the constant it give's me error like Pens.Red isn't a constant variable.
How do I make them constant?
Niklas Ulvinge aka IDK
|
|
|
|
|
You don't. Objects can't be constants.
You can make them static, though.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks, that's what I was looking for.
Niklas Ulvinge aka IDK
|
|
|
|
|
Make them readonly . That way, no one else can do surf = Brushes.Yellow or something like that.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Now it is:
readonly static protected Brush surf = Brushes.LightGray;
Isn't that the same as a const,
Readonly and only belongs to the type?
Niklas Ulvinge aka IDK
|
|
|
|
|
Hello
I am trying to replace the right (CTRL + SHIFT) keyboard action in the RichTextBox that changes the
reading order form LTR to RTL by code.
Any one has thought how to do this
Any help will help
Thank you in advance
|
|
|
|
|
Did you mean that you want simulate Ctrl+Shift by the code
ie the user dont have to press them to change the keyboard language
MCAD
|
|
|
|
|
dear friend
Yes ,you are right. in fact the main problem is that I have a richtext box
in my form that I load a rich text format file into richtext box,as the contents of file are in persian language richtextbox should show the text file
in right to left format,but RightToLeft property of richtextbox never made any
changes to richtextbox content but CTRL+Shift is working.
Please let me know if you could get through this problem.
many thanks.
M.jafarpour
|
|
|
|
|
You need to Set Keyboard layout to your input langauge you want Windows API Function have function called LoadKeyboardLayout use it to simultae Ctrl-Shift look at the folowing example
[DllImport("user32.dll")]
static extern IntPtr LoadKeyboardLayout(string pwszKLID, uint Flags);
const uint KLF_ACTIVATE = 1;
const string LANG_ARABIC = "00000401";
some where in your program write the following Code
LoadKeyboardLayout(LANG_ARABIC,KLF_ACTIVATE);
You will need to change LANG_ARABIC value to your language value for a Table of Language Identifiers look at
Language Identifiers [^]
For more info looka at LoadKeyBoardLayout[^]
MCAD
-- modified at 18:07 Sunday 11th September, 2005
|
|
|
|
|
Dear Friend
Well done.It is working properly, thanks for solution.
It is apear from your name that you are from a moslem
country, I apprecate and proud to had communication
with you.It is only one year that I am switched from
Vb 6.0 to C# , and almost a new..,I am dead set to
gain MCSD while is a big target for this my moment
C# status ,as a MCAD if you could advice me to
get this destination ,please dont hesitate.
Thanks and best regards
M.jafarpour
|
|
|
|
|
|
Hello
I have just made a notepad, but there is some problems.
1. When i select the program to be the standart editor for exampels *.txt
when i click the txt document the program just open my notepad but clean not with the text that should be in the document.. What can i do?
|
|
|
|
|
Did you handled Command Line Arguments when you associate your program to file type the file path passed to your application as command line arguments so you need to read those arguments and open the file and dispaly its content in your application
MCAD
|
|
|
|
|
If I create a list box with some items inside at designtime in the editor I can see thous very vell, but if I run my application the list box have the elements inside but I can't see thous. The color is right blu for text black for background.
What is the problem,? I tryed to renstall the framework but noting. The same problem is for combobox.
If I use the program in another computer the list box work.
Best regards.
|
|
|
|
|
I have a MessageBox that pops up in a try/catch block (catch). It has an
"OK" button and an "X" in the upper right of the Non-Client Rect.
Is there a way to access the behavior the "OK" and the "X"?
|
|
|
|
|
Anonymous wrote:
Is there a way to access the behavior the "OK" and the "X"?
That's really vague. What do you mena by "access the behavior"? What do you want to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I guess I want to know how to use them as parameters in a control struct.....if that makes sense -- thanks
|
|
|
|
|
SkunkedWorks wrote:
if that makes sense
Nope.
Are you saying that you want to use the return value from the MessageBox to determine which button was clicked?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
i have 2 problems, when i read the Excel-Tabel in the Datagrid!
<br />
string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=@C:\\Test.xls;" + "Extended Properties=Excel 8.0;" + "HDR=Yes;IMEX=1";<br />
<br />
OleDbConnection objConn = new OleDbConnection(sConnectionString);<br />
<br />
objConn.Open();<br />
<br />
OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Tabelle1$]", objConn); <--- An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll<br />
<br />
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();<br />
<br />
objAdapter1.SelectCommand = objCmdSelect;<br />
<br />
DataSet objDataset1 = new DataSet();<br />
<br />
objAdapter1.Fill(objDataset1, "XLData");<br />
<br />
dataGrid1.DataSource = objDataset1.Tables[0].DefaultView;<br />
dataGrid1.DataBind(); <-------- System.Windows.Forms.DataGrid' does not contain a definition for 'DataBind'<br />
<br />
// Clean up objects.<br />
objConn.Close();<br />
cu
|
|
|
|
|
Something more of the first error message, than just the type of the exception object, would be helpful...
The second error message is very straight forward. There simply does not exist any method called DataBind in that class.
---
b { font-weight: normal; }
|
|
|
|