|
Right, you're not allowed to modify a collection while you're using foreach , but you could try a regular for loop.
I didn't think there was anything you could do worse than sing, but you have exceeded my expectations.
|
|
|
|
|
I wanted to this .............. i got it this moring
private static Dictionary<book,object> getproperties(Dictionary<book,object> entries,string anyString)
{
Dictionary<book, object=""> mydict = new Dictionary<book, object="">();
/// Dictionary<book, object=""> d = new Dictionary<book, object="">();
foreach (Book mybook in entries.Keys)
{
mydict[mybook] = anyString;
}
return mydict;
}
|
|
|
|
|
And what is the error your getting when you try to do that?
It looks like your trying to copy the entries from one dictionary to another? If so, you should probably be using the Add() method instead of trying to do this through the indexer.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
i want to see a whole xml file in the richtext box. how can i see it or access it?
|
|
|
|
|
Use XmlDocument to load it - and then bind the text to the textbox.
|
|
|
|
|
plzzzzzz explain through code , i dint get you
thanks
|
|
|
|
|
|
Google "reading text file in C#", this is basic IO. It's a text file, look at the StreamReader , (or even the XmlTextReader if you really need it, though it doesn't sound like you do).
|
|
|
|
|
how do i create a line graph using c#, values will be in sql table???
|
|
|
|
|
Use a graph control. Read the point values out of the database and bind them to the graph.
|
|
|
|
|
how can i programatically search node in the treeview? and if i am accessing xml file in treeview, then how can i search the node in xml file too?
|
|
|
|
|
its urgent plz help meeeeeeeee
|
|
|
|
|
samidhas wrote: its urgent plz help meeeeeeeee
Tut tut. It's always urgent. Saying this is just plain rude and inconsiderate. Why do you think your requirements are any more urgent than all of the other posters?
This is a volunteer only forum, so you have to be patient and wait for the relevant volunteers to get round to answering your questions. Pestering people and posting crap like this makes it less likely that you will get help. We get very annoyed at people with attitudes like this.
|
|
|
|
|
Create a method that recursively searches through the ChildNodes in your treeview. To do this, pass the top most node in and then do a foreach on the ChildNodes, and if you haven't met your criteria recursively call the same method passing in the ChildNode that you are iterating over.
|
|
|
|
|
I have a control which is inherited from ListView . When user presses F2 key, I am invoking a delegate whose target is in other class. I need to pass an object as parameter to this delegate call. I want to know which one is the best method to do this.
1 - Pass as a ref parameter
2 - Pass as normal parameter.
OnF2KeyPressed(ref MyCustomObject) or OnF2KeyPressed(MyCustomObject) ? Which one do you suggest ? Why ?
|
|
|
|
|
Think about it... Why would you want to give another class a reference to your instance of your object, especially when this class is only coupled through a delegate?
It depends on what you plan on having this other class do though. If it needs to act on information in the object, a reference isn't needed. If it needs to make changes to the object a reference would be needed in this scenario, but if that's the case this is probably not the safest design to solve your problem.
If this is a test/homework question, think about the difference between passing by reference and by value and when each is appropriate.
|
|
|
|
|
In VC#, can we apply transformation (rotation) to DrawReversibleFrame?
I want to drag the rectangle (tracker) which is at, for example, 25 degrees (rotation).
If we use DrawRectangle while dragging it will leave traces...
Any solution?
|
|
|
|
|
I can see my database in a datagrid.
But I need to add, remove or edit some records in the datagrid and I like my database be updated according to the changes in Datagrid by clicking a button.
I will be greateful if help me.
Sourie
|
|
|
|
|
Hi all
I am launching from my Console C# program a child process using System::Diagnostics::Process class.
This child process throws an exception and the damned "do you wish to debug" window .
Is there any way to trap this kind of exception in my code?
Many Thanks
ManuStone
|
|
|
|
|
|
Off course I forgot to mention that I already used any kind of possible Exception for the Process.Start method. The application I am developing is a CONSOLE application launching a WIN32 application, in detail I am launching DEVENV i.e. the Visual Studio at command line.
|
|
|
|
|
Hi
I'm getting this error while trying to abort threads:
"Object Reference Not set to an instance of an object"
The code is:
<br />
try<br />
{<br />
Client_Login clog = new Client_Login();<br />
clog.clnt_th.Abort();<br />
clog.sock.Close();<br />
thvideo.Abort();
}<br />
catch(System.NullReferenceException expnul)<br />
{<br />
MessageBox.Show(expnul.Message);<br />
}<br />
plz help me out that How I abort my open threads as in above code some connection and threads are made in another class whereas the disconnect function is in main class.
Shanzay
|
|
|
|
|
|
Gareth,
clog is the object to access the control of thread which is use in other class and if I comment-out the clog aborting line then error on the thvideo.abort().Means error just come on abort() whatever thread I'm aborting.Got it?
Shanzay
|
|
|
|
|
Hello...
I have a problem. I try to show all property
in my object into a propertyGrid.
My class is something like this :
class MyClass
{
public Parent parent = new Parent();
}
class Parent
{
public Child child = new Child();
}
class Child
{
public string text = "Hello Child";
}
If I create a new instance from MyClass and
put it in property grid, I can only see a gray
text from "Parent". But I cannot go into it,
to see the "Child". There are no "+" sign.
How to make "Child" also editable in property grid ?
Thanks...
|
|
|
|