|
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#.
|
|
|
|
|
To be honest I don't think that you'll be able to avoid using pointers, the only way would be to use a wrapper around some stuff that did use pointers
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
|
|
|
|
|
I'll try to implement an algo similar to GarbageCollector one. With root references and scanning through the tree structure of each root. It won't be as generic as I wanted to. But going through pointers woul be very expensive in time for me.
|
|
|
|
|
kASTRATOR wrote: But going through pointers woul be very expensive in time for me.
That's whats most important
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
|
|
|
|
|
Hello,
I am developing a web app and trying to use Enterprise Library 2.0. I am using it for logging for now. I achived the logging on a flat file but when I tried to start doing the logging by using a DataBase Listener. I failed.
Here's how I am using it after including all possible references to my web app.
I configured a datasource with following attributes setup:
-Server (my server name)
-Database (my database in my server)
-Integrated Security (I used API.. something, false, true and I even tested after removing this tag aswell).
-user (my user name)
-pwd (my password)
Then I configured a Database Listner and gave the reference of my datasource.
Then I configured a Logging block by adding different categories and then I added reference to my Database listner in categories.
I also tested by adding and removing following in web.config within CodeDom tag:
type="Microsoft.CSharp.CSharpCodeProvider,
System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
compilerOptions="/d:TRACE" />
----------------
After doing this all when I try to log an entry after specifing the category to the entry and other required attributes. NOTHING HAPPENS in tables I generated after running the script file provided by Best Patterns and Practices team. I couldnt log any data.
Is there anybody who can help me or tell me what I am doing wrong?
|
|
|
|
|
Hi every body!
I need the C# code to back up a database and to restore it including sql code(using sql server). There should be ways to select the back up location and to select the backup file to restore. I'm thankful in advance if somebody can kindly provide me this help....please.
-- modified at 9:17 Wednesday 26th July, 2006
|
|
|
|
|
There are articles all over the web on how to do this. Just fire up Google or Search through the articles on this site.
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
|
|
|
|
|
In which situation we have to use abstract class & interface?
lavate
|
|
|
|