|
The idea isn't so bad, but let me tell you, how i load my Extract table and what my program did if i do that.
I load with a SQL script the Fulltable, thats not the problem.
But when i made a extract from the full table, sometimes there are more then 1000 records and for evry record there are 8 attributes, the program load 8000 times the eventhandler. small example
1 DataRow rw = table1.NewRow();
2 rw["Attribute"] = table2.Rows["row"]["Column"];
3 rw["Attribute"] = table2.Rows["row"]["Column"];
4 rw["Attribute"] = table2.Rows["row"]["Column"];
When i proceed Line 2 - 4, the Programm jumps 3 times into the EventHandler Function, why? I dont know.
And thats why i ask if there is a specific function to filter if it was a userentry or not.
|
|
|
|
|
Hi,
I am using a block of code to Import the Data to SQLServer2000
try
sqlTransaction sqlTran;
{
using (sqlTran = MyConnnection.BeginTansaction )
try
{
ImportData();
sqlTran.Commit();
}
catch(Exception ex)
{
sqlTran.Rollback()
}
}
catch
{}
Now as the Process start's If in middle of the Process I close the Window
the Process stop's, But the related tables in DB doesn't respond
Is that because rollback() is not called.If yes then Is it possible to calls Rollback in such situation.
Thanks
Navneet Hegde
Develop2Program & Program2Develop
|
|
|
|
|
Try putting the rollback and commit in a FINALLY block and set an indicator so you know which to execute. FINALLY blocks are always executed.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Thanks
So, if I close my Application through Task maNager, Then before ending the process FINALLY will be executed.
Develop2Program & Program2Develop
|
|
|
|
|
I doubt that!
Why on earth do you want to close the application through the Task Manager?
|
|
|
|
|
anyway!!
I wanted to be sure that my DB is not hanged in case of any eventuality.So Rollback is fired atleast.
Develop2Program & Program2Develop
|
|
|
|
|
Maybe. Put something like writing a file in the finally (so you know for sure) and try it.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: FINALLY blocks are always executed.
Not if the application is terminated outside its control, though I don't know why he's concerned about it.
|
|
|
|
|
If the application terminates unexpectedly the connection will be closed and any transaction will be rolled back.
|
|
|
|
|
Hi,
On my machine i installed two languages.
I wrote some application that using keyboard hook ( low level keyboard hook ).
In the run time i want to know witch of those languages is active.
How can i do it ?
Thanks for any help.
|
|
|
|
|
Why not just look up the Threads Current Culture?
|
|
|
|
|
OK,
I dont know how to do it -
can you please explain ?
|
|
|
|
|
So you wanna be spoonfed
System.Threading.Thread.CurrentThread.CurrentCulture
|
|
|
|
|
Hi,
I'm currently working on a C# app using MS Access as the database. In the database, it contains a SELECT stored procedure where one of its columns is something like Sum(IIf(WorkingDays(startDate, endDate)<=3,1,0)) AS Within3BusinessDays .
The WorkingDays(...) function basically counts the number of business days from the startDate to the endDate. Business days are weekdays (excluding Saturday and Sunday) AND non-holidays (holidays are listed in a separate Holiday table).
Now, my problem is... when I call this stored procedure in C#, it is getting an OleDbException with message "Undefined function 'WorkingDays' in expression." How can I fix this problem? I thought about removing the macro and just create a stored procedure that returns the # of working days instead but I don't know if that is possible since MS Access does NOT seem to use Transact-SQL.
Thank you in advance.
Rafferty
Rafferty
|
|
|
|
|
IIRC prefix the function with the qualifier, eg "dbo."
|
|
|
|
|
leppie wrote: IIRC prefix the function with the qualifier, eg "dbo."
Sorry I did not get what you meant by that. Going back to the stored procedure, are you suggesting that I simply change the Sum(IIf(WorkingDays(... to Sum(IIf(dbo.WorkingDays(...? I tried it but it didn't work. I'm now also getting an error even when I run the stored procedure in MS Access.
Please clarify.
Thanks again.
Rafferty
|
|
|
|
|
Sorry I cant help then
|
|
|
|
|
haha! okay, thanks for trying.
Rafferty
|
|
|
|
|
Hello everyone,
I want to monitor whether the handles of my C# application is released timely. The handles I mean various native handles wrapped by various Stream classes, like XMLReader/XMLWriter, Request.InputStream of Http request, etc.
(I do not use any native handles directly, and I only use C# wrap class like StreamReader.)
Currently, I am using Process Explorer --> Select the specific process for my C# application --> Select Properties --> Select Performance Tab --> Watch for "Handles" (including Handles, GDI Handles and USER Handles).
My questions are,
1. Is it the correct method to serve my purpose?
2. Any better tools or methods to use?
thanks in advance,
George
|
|
|
|
|
You could also use Perfmon (perfmon.msc) to track the number of handles open in the process. Perfmon can also log the information, which will be useful if you run the application for an extended period of time.
|
|
|
|
|
Thanks Senthil,
Do you mean the Handle Count for process counter? Or anything better?
regards,
George
|
|
|
|
|
George_George wrote: Do you mean the Handle Count for process counter?
Yes, I meant that.
That apart, if the objects wrapping the handles implement finalizers, and you don't accumulate references to such objects, the handle count should remain relatively constant.
|
|
|
|
|
Thanks Senthil!
1.
"That apart, if the objects wrapping the handles implement finalizers, and you don't accumulate references to such objects, the handle count should remain relatively constant." -- means if Finalizer is not called, the handle to be released in Finalizer is still counter as part of the Handle Count counter, but when Finalizer is called, the handle will not be counter as part of the Handle Count counter?
2.
If I call Close immediately after using the handle or using "using" block, then handle could be closed immediately, and and Handle Count is reduced immediately?
regards,
George
|
|
|
|
|
George_George wrote: means if Finalizer is not called, the handle to be released in Finalizer is still counter as part of the Handle Count counter, but when Finalizer is called, the handle will not be counter as part of the Handle Count counter?
There is no magic there. The finalizer, if implemented properly, will close any handles held by that object and therefore the counter will go down.
George_George wrote: If I call Close immediately after using the handle or using "using" block, then handle could be closed immediately, and and Handle Count is reduced immediately?
Yes, as long as the object correctly implements the IDisposable pattern.
|
|
|
|
|
Thanks Senthil!
Question answered.
regards,
George
|
|
|
|