|
Is there any Get function which can take Node name as a input parameter and returns all the children of that node ?
Any GetChildren(TreeNode TNode) kind of function which will return the children of that node ?
|
|
|
|
|
The Nodes property isn't satisfactory?
-- modified at 4:54 Thursday 4th January, 2007
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Isn't it Nodes ?
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Yes, thanks, I've modified the message...
of course:
I have no idea what I just said. But my intentions were sincere.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Odd, just noticed that the OP posted a message saying that the Nodes property didn't exist on the Windows.Forms version of TreeNode
Went to reply, got an error message "The data could not be found". Looks like he realised his mistake and deleted the message. Thank god no one replied to it otherwise the forum would be a mess.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Nodes property returns only root nodes and not children.
if anybody know a function which will return the children of any node then it will be helpful.
|
|
|
|
|
Nodes returns the children of the current one. Maybe you need the descendants (the children plus the children of the children and so on...), if so, be recursive with Nodes and good luck!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I want to know,How to know Store Procedure Input and Output parameters.
What I want.
When I pass any Store Procedure Name.it's return that Store Procedure Input and Output parameters.
Help me out
it's very arrgent.
Thanks
|
|
|
|
|
asif_aslam wrote: Hi,
I want to know,How to know Store Procedure Input and Output parameters.
What I want.
When I pass any Store Procedure Name.it's return that Store Procedure Input and Output parameters.
Help me out
it's very arrgent.
Thanks
Try this query
select specific_name, parameter_name, data_type, character_maximum_length, parameter_mode from information_schema.parameters where specific_name = @spName<br />
|
|
|
|
|
SqlConnection connection = .....
SqlCommand cmd = new SqlCommand();
cmd.Connection = connection;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = StoredProcedureName;
SqlParameter param = new SqlParameter("name", value);
//param.Direction = ParameterDirection.Input; // by default
//param.Direction = ParameterDirection.Output;
//param.Direction = ParameterDirection.InputOutput;
cmd.Parameters.Add(param);
|
|
|
|
|
Hi everyone,
I use the OLE connection to read data from excel file;
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFileName + "; Jet OLEDB:Engine Type=5;" + "Extended Properties=\"Excel 8.0;\"");
OleDbDataAdapter SheetAdapter = new OleDbDataAdapter("select * from [" + strSheetName + "]", conn);
But when using the method to read the excel data like this:
111111111
2222(ds)/1232(jjj)
It just return NULL to the dataset row.
I really don't know why ?
Can you help me please?
Thanks in advance.
|
|
|
|
|
Clearify question:
the 11111111 is returned well,
but can't get the next row - 2222(ds)/1232(jjj)
|
|
|
|
|
I want to display a form, which(name of form) is stored into a table.After firing query to that table I am getting appropriate value (e.g "frmSTART") into a string variable(myfrm = "frmSTART"),
now how can I treat a string variable value as an object?
So that I can write:
myfrm nSTART = new myfrm ();
nSTART.Show();
Hallo
|
|
|
|
|
Hello,
What you asked for is not possible!
.)
If you know all the possible class names during design time, you simple could make a switch case over the returned string.
string myform = actual_returned_string;
switch(myform)
{
case "test1":
{
MyTest1 t1 = new MyTest1();
break;
}
case "test2":
{
MyTest2 t1 = new MyTest2();
break;
}
default:
break;
}
.)
If you have to make it more dynamic, then you have to look into reflection.
Therefore you should know the namespace of youre formclasses.
You could use a method like this, which returns you a Form to Show.
using System.Reflection;
public System.Windows.Forms.Form GetFormByName(string _name)
{
Type t = Type.GetType(_name);
if (t != null)
{
ConstructorInfo c = t.GetConstructor(Type.EmptyTypes);
Object o = c.Invoke(new Object[0]);
return o as System.Windows.Forms.Form;
}
else
{
return null;
}
}
And you can call it like that:
string namespace =
string myform = namespace+actual_returned_string;
System.Windows.Forms.Form actForm = GetFormByName(myform);
Hope it works for you!
All the best,
Martin
|
|
|
|
|
I don't know why you got voted a 2 for that - I thought the reflection idea was sound.
|
|
|
|
|
Hello,
Colin Angus Mackay wrote: I don't know why you got voted a 2 for that - I thought the reflection idea was sound.
I have also no idea!
It would also be interesting for me to know way, cause I'm using reflection in my application.
So thank's for youre statement!
All the best,
Martin
|
|
|
|
|
Probably because the answer was above the person's comprehension.
|
|
|
|
|
ednrgc wrote: Probably because the answer was above the person's comprehension.
If someone gave me an answer that I didn't understand then I'd follow it up with a request for clarification. Oh, Well....
|
|
|
|
|
Hi
I have to detect either sql server (any version) and db2 are installed on my system or not through c#. Can someone tell me how can i do that?
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
|
Hi there,
What are the controls that can be added as UIElements? can a form be added as a UIElement in dockpanel? Any examples?
|
|
|
|
|
say i have my own defined class, MyClassA, MyClassB
MyClassB b;
MyClassA a = new MyClass(1,"MyName", b);
MyClassA aCopy = new MyClassA();
aCopy = a;
This will make aCopy point to the same object as a, being a reference. I want aCopy to be a distinct object from a, but equal in the sense that it has all its member-data equal in value to those of a. Is the best way to make a copy of another user-defined class through the copy-constructor?
Therefore:
MyClassA aCopy = new MyClassA(a);
provided the copy ctor is provided for MyClassA.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
That is certainly one way to do it. .NET also includes the ICloneable interface for the same purpose. Objects which could be copied would implement the interface's single method Clone() that would return a new copy of the object. From my reading, however, the use of this interface seems to be discouraged now due to the lack of consistent semantics regarding the copying act. That is, whether an object created a shallow copy or a deep copy is dependent on a particular implementation of ICloneable. The interface did not specify one way or the other. Plus, having been introduced in .NET 1.0 before generics, client use of ICloneable always required an ugly cast back to the original object type (because the Clone() method return an object of type System.Object). Nonetheless, in my opinion, creating a custom Clone() method that returns a new object of the same type is preferable to a copy constructor. In my mind, the intent of:
MyClassA a = new MyClass();
MyClassA aCopy = a.Clone();
is more obvious than:
MyClassA a = new MyClass();
MyClassA aCopy = new MyClassA(a);
-Phil
|
|
|
|
|
Hello everyone!
Hey, so I need to use System.Net.Sockets.Socket.BeginAccept() , but I'm forced to use System.AsyncCallback to pass a callback function... What if I want to use my own event instead? How can I do that? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Can someone explain why numbers are being dropped off in this regular expression replace statement??
string phone = "1012345678912345";<br />
string newphone = Regex.Replace(phone, @"^((?<country>[1])([ ]|.|-))(\(|\[)?(?<area>\d{3})(\)[ ]?|\][ ]?|.|-)?(?<prefix>\d{3})(.|-|[ ])?(?<suffix>\d{4})[ ]?(x|X|#|.)?(?<ext>\d{0,5})$", "${country} (${area}) ${prefix}-${suffix} #${ext}"); <br />
<br />
newphone = newphone.TrimEnd('#');<br />
newphone = newphone.Trim();<br />
<br />
Console.WriteLine(newphone);<br />
The output is: 1 (123) 567-9123 #5
What it should be is 1 (012) 345-6789 #12345
Why is a number being removed between each storage area??? Thanks for your help.
|
|
|
|