|
Thanks for replying.
I am checking the control size if it is greater than 20 if so then setting the control left size. I even tried with
if(c.Width > 20 && c.Height > 20)
didn't really affect. I am sitting looking to solove this problem though.
|
|
|
|
|
netJP12L wrote: setting the control left size
The Left Size? As I remembered Left property gets or sets the position of a control in its container.
According to MSDN:
Control.Left: Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
Does it make any difference?
When you're alone in the Dark, Fear will protect you...
|
|
|
|
|
Hello all,
I am planning to add Tracing instrumentation to our application. This would result in tons of adding Tracing and logging statements in almost all methods of main areas of application. Even when tracing is disabled, at minimum these statements would atleast evaluate TracingEnabled==False/True logic, which i think will have some performance impact. Any better ideas are appreciated.
Thanks.
modified on Friday, November 14, 2008 12:15 PM
|
|
|
|
|
You might want to look at Log4Net and/or an AOP framework like PostSharp. It's hard to say what the actual timing impact will be, but something like this seems more of a performance issue in actually doing the instrumentation IMHO.
Scott P
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|
|
This doesn't help you right now, but you could beg Microsoft to include useful things like proper preprocessor macros the next time they make a programming language.
You could fudge it, sorta' like this:
void Breakpoint()
{
#if _BREAK_ENABLED
System.Diagnostics.Debugger.Break();
#endif
}
I'm pretty sure that calls to empty function bodies are effectively eliminated by the time the JIT comes into play, but I could be wrong.
--
Abort, Retry, Hurl computer into the hellfire in which it was forged?
|
|
|
|
|
Scott Bruno wrote: you could beg Microsoft to include useful things like proper preprocessor macros the next time they make a programming language
It was a deliberate decision to avoid preprocessor macros when the C# language was designed. You can do a lot with them, but they are widely used in ways that make it harder to understand the code, which is the opposite of the philosophy of the C# language.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: It was a deliberate decision
Oh really? And all this time I thought it was accidental.
I know why they did it. I just disagree with the practice of neutering languages in an attempt to open up platform development to the less capable.
--
Abort, Retry, Hurl computer into the hellfire in which it was forged?
|
|
|
|
|
If you're using .NET 3, I'd consider using Partial methods and the Conditional attribute. A better bet though would be to use Inversion of Control to implement the tracing only when it's needed. Take a look at the Unity framework for more information/details.
|
|
|
|
|
Thanks all you guys. I will take look at unity framework, which Pete suggested.
|
|
|
|
|
HI
I have taken over a project from a former employee, I have not done OO programming for about 10 years so it is like starting over. The biggest problem I have at the moment is this. I have a grid that is populated from a dataset that I believe gets it's data from a db on my d drive. I cannot find where he defines the connection etc. I believe he did this in a using declaration but not sure. The problem is I need to take the changes from the grid and upda te the DB. When you click an update button. There is a command that already there that updates the dataset with the changes.
this.propertyTableAdapter.Update(pROTOTYP_DBDataSet.Property);
He then used this command to repopulate the grid. I do not know how to use this dataset to update the DB. I tried creating a new dataset that I was going to point at the DB but it does not show me the tables that are in the one I copied. This is the code I tried
PROTOTYP_DB.mdf
DataSet pROTOTYPDB = new DataSet();
pROTOTYPDB = pROTOTYP_DBDataSet;
If anyone could help I would really appreeciate it, I am under a tight deadline to get this woorking. The path to the DB is D:\pm_demo\PM.Runtime.Demo
Thanks
|
|
|
|
|
|
OK I'm a database programmer and have no experience with graphic programming.
My boss is wondering if I can read data into an animated display.
Similar to an o-scope. Scrolling value and time base with the data line graph in real time.
Where can I find some info on how to get something like this started??
TIA
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
The most efficient way should be using a third party control. For example Steema[^] has a graph type FastLine in TeeChart component library.
Another possibility could be Dundas[^].
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Well, it appears as if normal (non administrator) users using Vista don't have sufficient permissions to allow applications to create/write event log. Is this true? If so, that's insanely stupid.
Is there a work-around that doesn't involve running the application as administrator?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You should be able to write to an event log, its creating an EventSource that you cant do using a normal account.
This was the case pre-vista as well. generally you create the event source using an installer that must be run as adminsitartor to succeed.
|
|
|
|
|
Exactly what J4amieC said. Just to add, that typically I create necessary event sources during the setup process since the setup is often (in my cases) ran using an administrator account.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Dear all I'm looking for some advice.
An access 2003 app exist on a corporate network but does not have the functionality required. IT won't support a connection to their SQL server and the app needs to be redevloped to included additional functionailty.
There are a number of locations where staff logon to a shared drive and need to update information in the database. There's around 10 users.
My question is should I redevelop the app to be a desktop application (c#) with an access backend or use something else.
Thank you for any information you can offer.
|
|
|
|
|
Have a look at the compact database, offered by microsoft. Its free and is just a file that would be placed on a share that is backed up. You could then write a c# winform app to sit ontop of it.
It really depends where you skillset is, I would do the above, as i could do that quicker than using access (as i have not used access for a lonnnnng time)
Mark
|
|
|
|
|
Why not use SQL Server Express Edition. If you build a totally new instance (on a separate machine), could the suppport be arranged since it's not disturbing any of the existing instances. Express edition is free and it's targeted for multi-user environments like Access, but has more capabilites (Compact edition cannot be used in multi user environments and all other editions aren't free to use).
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Use the Express edition of SQL Server. It should provide you plenty of functionality without having to deal with your IT not sharing their server.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Hello everyone,
For the exception constructor,
Exception Constructor (SerializationInfo, StreamingContext)
http://msdn.microsoft.com/en-us/library/tz6bzkbf.aspx
I have two questions,
1. I saw some code defines it as public and some other code defines it as protected. What are the different purposes of different definitions?
2. I saw some code which defines a new exception type derives from System.Exception, and implements this contructor, but the implementation code is just call the base class constructor, and at the same time, the class is marked with Serializable tag. Like this.
I think such type of implementation is useless since the implementation of constructor is empty (just call base class contructor and the class is already marked with Serializable tag), so it is system default behavior and it should be ok to just mark it with Serializable tag to achieve the same effect.
Any comments?
[Serializable]
public class MyExceptionClass : Exception
{
public MyExceptionClass (string errorMessage)
{
}
public MyExceptionClass (SerializationInfo info, StreamingContext context) : base (nfo, context)
{
}
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: Any comments?
Yes, as usual you need to read the documentation (In this case of SerializableAttribute, ISerializable and Exception).
|
|
|
|
|
Thanks J4amieC,
I asked two questions. Your reply "yes" is for which one?
regards,
George
|
|
|
|