|
ss.mmm wrote: TreeNode _Del = new TreeNode();
_Del.Text = "Administrator";
_Del.NavigateUrl = "~\\Form1.aspx";
as you are navigating to the same URL, so quick fix is to add a parameter in the URL like:
<br />
_Del.NavigateUrl = "~\\Form1.aspx?node=1";<br />
<br />
and <br />
<br />
_Del1.NavigateUrl = "~\\Form1.aspx?node=2";
and in the code you can show and hide the panels based on node.
-----
|
|
|
|
|
Bad news I know. Does this extend to altering the Tag property on a control too though? I'm stuck in a .NET 1.1 environment (God, give me strength....) so I don't get any helpful exceptions showing me the way.
Regards,
Rob Philpott.
|
|
|
|
|
Hi
As far as i know the cross thread exceptions came up with .net 2.0 so theory says you should be able to change a property of a control from a non-gui thread in 1.x.
but.
as in .net 2.0, 1.1 has the property invokeRequired too. so you can do the same as in 2.0 with Control.Invoke(....)
greets
m@u
|
|
|
|
|
Hey, thanks for the reply.
I know the exceptions were introduced in 2.0, but the rule certainly appied before that. The problem is most the time you'd get away with it, but on occasion it would go wrong so they decided to enforce it in version 2.
Regards,
Rob Philpott.
|
|
|
|
|
Ok then i'm lucky i think i still have some (very..) old code that does that ugly cross-thread thing without invoke..
anyway.. you said you don't get a meaningful exception. do you get an exception at all or does the app just hang?
|
|
|
|
|
Hi,
a thread that did not create a Control, should not access that Control, except for the
very few members explicitly allowed, including InvokeRequired and Invoke (but not Tag).
Before .NET 2.0 the app may behave badly, the GUI may freeze, anything can go wrong if
you violate the rule.
Since 2.0 you get an InvalidOperationException by default; you can disable that by setting
Control.CheckForIllegalCrossThreadCalls false, but that is a very bad idea, and it brings
you back in the previous situation.
Since most if not all Controls are somehow related (they are on a Form, one Form owns
another Form, etc), the natural consequence is all Controls get created and accessed
exclusively by a single thread, typically your initial or main thread, often also called
the "GUI thread".
There are lots of examples on InvokeRequired/Invoke available everywhere;
a rather advanced article on the subject is here[^].
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I am trying to insert data into excel, i usually have no problems, i only have one specific problem:
If the Column Header is named "Job#" the Insert satement fails because it says it can't find column Job#. i have tried everything i can think of to get the # escaped so it doesn't think its a special character. I am using the OLEDB provider to insert with the excel Jet object. Anyone have any advice?????
Thanls
Marios
|
|
|
|
|
Try using (char)35 - I have sometimes found this can work in the sort of situation you are describing.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
No that doesn't work
Thanks
Marios
|
|
|
|
|
Try enclosing the column names into brackets. e.g. INSERT INTO table ([Job#],....
Regards
Aftab Sindhi
.NET Application Developer
U.A.E
|
|
|
|
|
Hi guys let me start by a code exemple
public Array Maproriete1
{
get { return Maproriete; }
}
how can I make may Array values in readOnly so that i can't modify them.
thanks!!
|
|
|
|
|
You can't like that. Either provide a method, say, GetMapOriete(int index) to return an element or you might considering cloning the array and returning that. Although not exactly read-only, it wouldn't affect your copy.
Regards,
Rob Philpott.
|
|
|
|
|
If you don't mind returning a List (instead of an Array), you could return a ReadOnly version of the collection.
public IList<string> Names {
get {
return new _names.AsReadonly();
}
}
private List<string> _names = new List<string>(); /ravi
|
|
|
|
|
how to read particular data from xml file
|
|
|
|
|
well you can load the xml document in dataset using dataset.ReadXML or you can load the xml document using xmldocument.load and then read the data using xpath or best thing is to google it[^]
-----
|
|
|
|
|
|
If the XML file is small, I would use Xml Serialization that will convert the textual xml file into an object which would be easy to read since it is an object.
If hte XML file is a complex large file, then you can use the XmlReader class that that you can traverse the structure and process it.
Either way, take a look MSDN website and you will find excellent examples that Microsoft provided you.
Microsoft Student Partner
|
|
|
|
|
My problem is how can I run C# programs.
Iam not Able to Install Dot net Visual studio C# on
Windows XP platform.
Would U pls Sir/Madam help me to find the way out.
Thanks in advance...
From Tesfatsion
|
|
|
|
|
You must install the relevant version of the .NET Framework on the target machine. This is a free download. You can also include it in your installation package so that it gets installed with your application.
|
|
|
|
|
Respect to you Colin. You doing a splendid job of answering the broadest possible questions this afternoon!
Regards,
Rob Philpott.
|
|
|
|
|
I am unable to run following source code using Lucene.Net.Dll 2.0.0.4 :
http://www.codeproject.com/useritems/Search_with_in_documents.asp
Main problems is that in this source file the author used to references of one class library name classlibrary.dll and the lucene.net.dll. I just want to run this projet using only lucene.net.dll.
Please help me.
|
|
|
|
|
I have three different C# applications that I have to put together as one. Any ideas?
a novice
|
|
|
|
|
Ofori Boadu wrote: I have three different C# applications that I have to put together as one. Any ideas?
Extract the code into class libraries (where they are not already) and create a new application that references these class libraries.
|
|
|
|
|
Ofori Boadu wrote: I have three different C# applications that I have to put together as one. Any ideas?
Well if that' all the requirements you have, you're screwed. That indicates you will be using the Software Rocks Process.
Someone gave you a project by telling you they want you to get them a rock. You run off and find one and bring it back and they look at it and say "Oh no I wanted a larger rock". So you run off again and find a larger rock and bring it to them and they say "Oh no I wanted a flatter rock". So you run off again and find a flatter rock and bring it to them and they say "Oh no I wanted a smoother rock". So you run off again and.... well you get the point.... I hope, good luck.
|
|
|
|
|
I could do with some feedback on some development I am doing.
I am writing a class to return file information within a directory.
The class allows a recursive search of the directory - so the class will enable you to pull all the file information, for instance, from the C: drive or a mapped network drive.
Originally I tried the System.IO.Directory class however I found that the GetFiles method fell over with exceptions on certain files (system files, etc...).
The class I am writing threads the searching so that one can access file information as it is being found (searching C: can take a couple of minutes!).
Have I gone to the trouble of creating a class for which there is already a solution?
Regards
Guy
You always pass failure on the way to success.
|
|
|
|