|
ok, i read an article about reflection!
and found out som new:
-------------------------------------
class abc()
{
public int parametername = 0;
public string parametername2 = String.Empty;
}
class ReadParameterName()
{
Type TypeToReflect = typeof(abc);
System.Reflection.MemberInfo[] Members = TypeToReflect.GetMembers();
// now i get an array with the members of the object 'abc'
// can i get an enum of the membernames in realtime?
???
// so that i can select any membername from the enum like:
string anyMemberName = enumAbcMembers.parametername.ToString();
}
-------------------------------------
|
|
|
|
|
Hi
Here is another way to do the same thing.
If I'm right it's one of the refactoring practices.
Use an object instead of a struct(int,string,...)
You can have a parameter class:
-------------
Parameter
-------------
+Name:string
+Value:object
-------------
-------------
Then one may write
<br />
Parameter param1=new Parameter("abc",0);<br />
Parameter param2=new Parameter("anotherParam",1);<br />
and later:
<br />
string paramName=param1.Name;<br />
I prefer this method because my intention is implied(Everyone can look at the class interface and see what's going on)
Regards
|
|
|
|
|
i want to delete a node in Binary Search Tree, what would i do?
Please guide me. Thanks a lot.
|
|
|
|
|
Hello zoro,
What is the problem?
Can u give structure or class defination of node?
regards,
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
i'll send to you my class that define node
public class Node
{
private Node leftNode;
private int data;
private Node rightNode;
//This is propety
public Node RightNode
{........}
public Node LeftNode
{........}
public int Data
{........}
And I don't know how to delete node in binary search tree.
}
please guide to me!
thanks!
|
|
|
|
|
If the node to be deleted has children you have to move one of the children up and rebalance the other children into the the other child. Draw a picture, it helps.
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
|
|
|
|
|
i know how to delete but i don't know write it by C#. Because i don't know what method that delete node, for example,
//assign node that want to delete to TempNode
TempNode = NodeDelete;
//how to delete TempNode
//it's problem with me
|
|
|
|
|
appearantly not.
hkim_zoro wrote: i know how to delete but i don't know write it by C#
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
me too.
and do u know about Red Black Tree?
if u have document of it, can u send me?
my email: hk171284@yahoo.com
thanks alot!!!
|
|
|
|
|
When i try to implement text to speech application asp.net using Microsoft Speech Lib com component .
Im getting the following error
Class Not Registered : Com Interopable Exception
SpVoice voice = new SpVoice();
voice.Speak("Welcome to Sindhu synergy",SpeechVoiceSpeakFlags.SVSFDefault);
trtyrt trhrt r rtrtytrr t
|
|
|
|
|
You need to register your com object, with regsvr32. browse to the folder the dll is in ( in a command window ) and type regsvr32 dllname.dll
It may need a command switch, but I don't think so, I think registering is the default.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi all
i have two DataTable in DataSet....
also have One common column...
i want to join these two DataTables using that common column
and single dataTable as result.
<>
DataTable examgrade;
DataTable students;
examgrade = new DataTable();
examgrade.Columns.Add("STUDENTID", typeof(int));
examgrade.Columns.Add("GRADE", typeof(string));
addExamgrade(101, "A");
addExamgrade(102, "B-");
addExamgrade(500, "C");
addExamgrade(150, "FAIL");
students = new DataTable();
students.Columns.Add("STUDENTID", typeof(int));
students.Columns.Add("STUDENTNAME", typeof(string));
students.Columns.Add("YEARENROLLED", typeof(int));
addstudent(400, "Fred", 1982);
addstudent(300, "John", 1975);
addstudent(100, "Mark", 2003);
addstudent(500, "Mary", 1960);
addstudent(150, "Jane", 2002);
DataSet ds = new DataSet();
ds.Tables.Add(examgrade);
ds.Tables.Add(students);
DataColumn dcParentStudentID = ds.Tables[0].Columns["STUDENTID"];
DataColumn dcParentGrade = ds.Tables[0].Columns["GRADE"];
DataColumn dcChildStudentID = ds.Tables[1].Columns["STUDENTID"];
DataColumn dcChildStudentName = ds.Tables[1].Columns["STUDENTNAME"];
DataColumn dcChildYearEnrolled = ds.Tables[1].Columns["YEARENROLLED"];
DataRelation dr = new DataRelation("join", new
DataColumn[] { dcParentStudentID }, new
DataColumn[] { dcChildStudentID }, false);
ds.Relations.Add(dr);
private void addExamgrade(int studentID, string grade)
{
DataRow dr = examgrade.NewRow();
dr["STUDENTID"] = studentID;
dr["GRADE"] = grade;
examgrade.Rows.Add(dr);
}
private void addstudent(int studentID, string studentname, int
yearenrolled)
{
DataRow dr = students.NewRow();
dr["STUDENTID"] = studentID;
dr["STUDENTNAME"] = studentname;
dr["YEARENROLLED"] = yearenrolled;
students.Rows.Add(dr);
}
<>
but what after this???
Sheetal.
-- modified at 5:30 Friday 18th August, 2006
|
|
|
|
|
plz help me....anybody?
bye bye.
|
|
|
|
|
how can i store picture in database as binary
and select as binary to imagebox
thanks for help
MD_NADA
|
|
|
|
|
I have several ComboBoxes which have a string "(null)" added as the first item and then the rest of the list is populated from a List (of strongly-typed classes).
When I try and set the SelectedItem (or SelectedIndex) property, internally it is selected but it's not updating the UI. E.g.
if (itemToLoad == null)
{
comboBox.SelectedItem = "(null)";
}
else
{
comboBox.SelectedItem = itemToLoad;
}
Now if in the debugger (or later on in the code) the SelectedItem is queried it shows that comboBox has the correct item selected but it has not changed the text in comboBox to reflect the change.
Any ideas on why this is happening and/or how to fix it?
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
|
|
|
|
|
Never mind, it was application specific code which was doing 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
|
|
|
|
|
Is there a good tutorial somewhere on Setup projects?
I can manage adding files and putting them in the right directory, but also want to show some extra info, perform command line commands and execute some sql statements (changing or updating tables, ...).
Also being able to provide some choices (which language etc) and creating a config file would be nice.
I don't have a good idea where to start with this stuff.
tnx for the info !
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
Hi,
I don't know if the setup projects available in Visual Studio will allow you to do something like what you want. You could try to use this
Do your best to be the best
-- modified at 6:24 Friday 18th August, 2006
|
|
|
|
|
|
Hi gurus,
I am facing a problem while validating float,date,time values in string variables in c#. Can Anybody tell me the way to validate the values.
plz help.
thanks in advance.
Nitin...
|
|
|
|
|
Use Double.TryParse or DateTime.TryParse .
"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,
i checked the way you suggested,
it worked with double.tryparse but there is no such option like datetime.tryparse.
please check this out.
thanks.
Nitin.
|
|
|
|
|
There is a DateTime.TryParse method! It's new with the Framework 2.0 but as you found double.TryParse you're clearly using this version. Maybe you misspelled.
"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,
thanks for your reply but sorry to say i cant find DateTime.TryParse.
|
|
|
|
|