|
Thanks
It worked for me
|
|
|
|
|
Hello guyz,
I am using Enterprise Library 2.0 and trying to do logging in database. What I have found is that if I use a database where I have integrated security on I can use my database listener to use database for logging but when i use Integrated Security = false with user id = sa and password = abs then Enterprise Library doesnt do any logging in database.
I must use user from database e.g "sa" I am not suppose to use integrated security.
Any idea how can I do it?
Thanks in advance.
|
|
|
|
|
Perhaps its just a lack of my knowledge of C#, which is why I am asking here for potential solutions. Thanks ahead of time for trying to help me out here.
I have a custom attribute class that is used in conjunction with my PropertyGrid, where the data is being populated from an XML file. All of this works fine and the data shows up in the PropertyGrid as expected, but all the data is marked in bold (meaning its different then its default value). Now, to set a default value in a custom attribute you use:
[DefaultValue(false)]
The only problem, is that because the default value is based off of what's in the XML file, I obviously cannot set it, due to it not being a constant. I need to be able to set the default values in the attribute class with the data that's loaded from the file.
Anyone have any suggestions on how to go about that?
Thanks,
Jacob
|
|
|
|
|
Quite a while ago I wanted to have my property grid dynamically change the the ability to see and edit data based on security in the Active Directory tree. A year later we had an awesome product, but I was deeper into the property grid then I'd ever want to be.
Bottom line: Everything in the grid is driven by attributes...and there is no way to directly change an attribute. So you must do alot of object binding to catch the calls for the attribute value and do your own determination. It is a long and (sometimes) frustrating process that is not the most flexible. If you want to persue this, then first search the forum for my user name going back the past 3 years. You should find many discussions on property grid info there. Also you will find alot of info here[^] and here.[^]
|
|
|
|
|
I went through your example and even tried bringing your code into what I was doing. Great functionality by the way, easy to use. However, when I set the default value on the property, it still displays the data in bold on the property grid.
Might it be something else?
Thank you,
Jacob
-- modified at 16:27 Wednesday 26th July, 2006
Ignore this. It was my error. Thanks a ton for your assistance.
Jacob
|
|
|
|
|
Hello
I asume what you whant to do is not possible, but I think its good as it is.
Otherwise you would have to initialize your Class Properties also dynamical (Or are you doing that?)
I think the sence of DefaultValue is that there you decrease your designer generated code.
If you change DefaultValue of a property dynamic and your initialized class variable stayes the same, your classes behavior could change in a way you don't whant.
Hope that makes sence,
All the best,
Martin
|
|
|
|
|
// When a program often has to try keys that turn out not to
// be in the dictionary, TryGetValue can be a more efficient
// way to retrieve values.
string value = "";
if (openWith.TryGetValue("tif", out value))
{Console.WriteLine("For key = \"tif\", value = {0}.", value);}
else
{Console.WriteLine("Key = \"tif\" is not found.");}
What is value? value of the dictionary i.e. in this case openWith.value?
|
|
|
|
|
This method has to return two things: a boolean indicating if the key is valid and the value associated with a key. You know that a function can only return one thing. So it uses an out parameter to return the value. So the TryGetValue method returns true if the key exists or false if the key does not exist. If the key exists, then the variable value will be set to the string associated with that key.
Logifusion[^]
|
|
|
|
|
Can a Hashtable accept two key values that are the same? if yes, then why can't a dictioanary accept two key values that are the same as it inherits from the hashtable class?
|
|
|
|
|
Both will throw an exception when you do an Add() with the same key. You can change the value paired with a key with the indexer though.
Logifusion[^]
|
|
|
|
|
You have to write your own in order to have duplicates and there are a lot of valid reasons to have duplicates. A possible solution is to associate the key with a list or hash and inside the list have the objects with duplicate keys.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
I have a database driven application. Now i dont know what to use for database support, either MSDE or SQL Express Edition. Please tell me which one is better. Also guide me how to integrate one in my Dot Net application?
Regards,
Wasif Ehsan.
-- modified at 11:24 Wednesday 26th July, 2006
|
|
|
|
|
wasife wrote: i dont know what to use for database support, either MSDE or SQL Express Edition
MSDE is the "lite" version of SQL 2000 and SQL Express is the "lite" version for SQL 2005. Either is good, but I would personally go with SQL 2005 Express, it is newer and there is a message a few days back stating that Microsoft does not support MSDE with Windows Vista. Microsoft does not support MSDE with Windows Vista[^]
wasife wrote: Also guide me how to integrate one in my Dot Net application
Do a general search on this site and Google around[^]
-- modified at 12:30 Wednesday 26th July, 2006
|
|
|
|
|
I have an existing C# application, I have to globalize it, and make localization available for german /french and UK english.
I have not done this before, and I would appreciate, if some one can guide me to any tutorials, links, books, which can help me do this.
Thanks,
|
|
|
|
|
I have not had to do this yet either, but I have found Matthew MacDonald's book, "User Interfaces in C#" from Apress books extremely helpful, and it appears he has a "cookbook" approach to this in one of his chapters.
I am going to have to do this as well in a little while. I'd like to hear from you on how your experience goes.
WhiteWizard
aka Gandalf
|
|
|
|
|
In case you're using Visual Studio it's pretty simple. Design your form as usual with the wanted default language. If your finished, select your form and go to the properties editor. Apply true to the Localizable property and for every additional language apply the according region code to the Language property and translate all UI controls. You find more detailed information on MSDN. Just search for Globalization or Localization.
At the end some advertisment: If you're interested in allowing the user to change the language at runtime take a look at my article covering this topic here on CP: UICultureChanger component[^]
Good luck
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
hi all,
i have a few questions to ask about listview component.
i have a listview with two columns(item, price).
i want to let users change the price but not the item fields.
(but in price field, they should only type characters from 0 to 9)
secondly i dont want users to resize the listview's columnheaders.
(this is an easy thing but i couldnt find that in property window)
the first one is so important!
hope that u gonna help me...
thanks in advance,
bye.
|
|
|
|
|
Mehmet Fatih Akbulut wrote: i want to let users change the price but not the item fields.
Easiest way is to put it as the first column, the subitems can't be edited I seem to remember.
Mehmet Fatih Akbulut wrote: but in price field, they should only type characters from 0 to 9
There should be an AfterLabelEdit event, you can use this to check the characters entered.
Mehmet Fatih Akbulut wrote: secondly i dont want users to resize the listview's columnheaders
I think you can set HeaderStyle to NonClickable to accomplish this.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi guys,
I am getting this message when I try to run my custom tool to generate code for my crystal report. I just migrated from VS2003 to 2005. Please help, I am clueless on this.
Thanks
sasa
|
|
|
|
|
|
Is that possible in C#, to search for objects of a certain type that are currently alive (in memory).
|
|
|
|
|
kASTRATOR wrote: objects
If you mean .NET objects then...
You can use the System.Diagnostics namespace to get process information. From there you can get the paths of any executables or dlls etc, you can load these using the System.Reflection namespace and then scan through the assemblies using Reflection for the objects you want. You probably can't get a copy of the objects currently in memory as Windows and the framework will disallow this (although there might be a way).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi;
Thanks for your answer.
I did study this possibility but I could'nt find a way to get references to .NET Objects.
By Reflection all I can have is the structure of the loded modules but I can't actually see which calsses have been instanciated , how many times and what are the references to these instances.
I know it is possible though because CLR Profiler can generate a snapshot graph of managed memory with the reference and memory adresses of each .NET object.
|
|
|
|
|
kASTRATOR wrote: CLR Profiler
Yes but is that using Managed or Unmanaged code. If it's C++ with some C++/CLI involved then it might be able to since it can inject itself into processes.
I havn't tried any of this, just giving you my thoughts. I havn't even used the CLR Profiler.
If the profiler is managed (which I doubt) then you can take a look through it's code with Reflector.
Did you know that you can get the source code to the profiler. Just google for CRL Profiler and the first result will be for .NET 1.1. A few results later (~5) there is a blog which contains a link to one for .NET 2.0.
Maybe this will help you if you look through the source code.
|
|
|
|
|
As you advised; I just took a look to see how CLR Profiler manage scanning memory.
It seems he's using a C++ unmanaged library that goes with pointers arithmetics.
I would like to avoid going through pointers; I'd rather find a solution to do it in C#.
|
|
|
|