|
Thanks Mark for your example, it's definately not a homework assignment (I wish!). I generalized the example quite a lot to hopefully explain the issue clearly.
I have looked at generics but I still can't get my head around how I could have a constructor to load a property from an ID without knowing the type in advance.
I won't have the name and value with which to load the property as in your example above, just an int ID.
<br />
Property propAny = new Property(1);<br />
<br />
Property<?> propAny = new Property<?>(1);<br />
? =
sorry if I'm missing the obvious here but I don't see how this works.
Thanks in advance
Mac.
|
|
|
|
|
You are going to have to rethink your architecture then. Other than using object for everything there is no way I know of to support all cases of unknown types.
only two letters away from being an asset
|
|
|
|
|
ok will have a think about it, I don't like the idea of using object much, seems like a hack approach but I liked the idea of having the values strongly typed each with the business rules encapsulated.
thanks for the help though, much appreciated.
Mac.
|
|
|
|
|
can anybody help me reading the elements of xml document???
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Get the document element using following code:
XmlDocument xmlDoc = new XmlDocument();
xmlNode root = xmlDoc.DocumentElement;
XmlNode node = root.FirstChild;
Now you can traverse all nodes of xml file depending upon the structure of file, using a simple while loop....
while (node != null)
{
node = node.NextSibling;
// or
node = node.FirstChild;
// etc.
}
Hope that helps....
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Hi!
I am using datagridview control to display records, in my datagridview mostly more than 50000 records are displayed. after every 5 seconds the control is refreshed and new datasource is assigned to it.
Now when i am scrolling the datagridview and meanwhile timer refreshes the control, it brings me back to the first row of control. which is quite annoying when you are on 30000th row.
I want to maintain the view of control after it is refreshed. I tried to save the e.oldValue of ScrollEventArgs in dgv1_Scroll eventhandler and then after refresh assigning it to e.newValue but it did'nt worked....
I achieved this by saving the index of selected row and then after refresh selecting that row again, but i want to do it without selecting any row...is it possible to save the scoll value and then restore it....?
Thanks in advance...
Regards,
Affan Ahmad Toor
.....................................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Hi Codeguru´s,
Can somebody help me - i´ve a big problem:
In my C# Windows Application i want to get all entries from our MS Exchange Server 2003 public Folger (Calendar).
have someone an idea?
bye
Markus
|
|
|
|
|
Is there any way to integre the DIVX player.
else
Is there any light movie player controller which can support all type of movies, if the relavent codec is installed.
any help is appriciated
Ravikumar
|
|
|
|
|
Hi
how can i read xml string in c#??
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
hi
XmlDocument doc = new XmlDocument();
doc.LoadXML(xmlString);
regards
|
|
|
|
|
If the user input data in textbox, i want to get that data and store it.
Just like, Console.Write(); / Console.Read();
---// in textbox????
thanks in advance,
to know everything is to know yourself...
|
|
|
|
|
Don't double post, I have already answered your question
|
|
|
|
|
As far as i understood your question, there is a property named Text for a textbox, you can store it using textbox1.Text!
Adeel
--
|
|
|
|
|
When the user input a data in textbox, i wanna get that data
and store it. just like in Console.Write / Console.Read
--// in textbox???
thanks in advance.
to know everything is to know yourself...
|
|
|
|
|
Text property of the textbox class will help you. You can get it or set
|
|
|
|
|
user textbox.Text
My small attempt...
|
|
|
|
|
user textbox.Text
My small attempt...
|
|
|
|
|
hi
i have problem in c# when i move picture from pannel all pannel area are flicking when i move the picture,
i m not using picture box, i draw image creating coustem class
please help
uttam
professionalbkn@yahoo.com
lead the world be professional
|
|
|
|
|
|
AOA:
I have developed an application which has to save some HTML text to database in the same manner as the html text is.
Can anybody guide me
Thanx
|
|
|
|
|
u can create a table ,make td runat="server" . Design the text such that it is in
the td.And make use of "td1.InnerText" in the cs .
hello every one
|
|
|
|
|
I'm trying to burn simple data DVDs programatically.
I want to support WinXP and up.
I don't want to use NeroSDK because of requirements/licensing.
From what I can make out IMAPI wrapper will not give me DVD burning in XP, only in Vista.
I'd really like to avoid executing external apps, I'd rather keep it all within my app.
Anyone know of something? I know they are out there, there are dozens of free CD/DVD burning apps about, they know something I don't and I'm having a tough time finding it.
|
|
|
|
|
Hi
I have a problem of finding and adding the attributes in arraylist in .net. I have the follwoing xml
<Domains>
<Domain ID="01" Name="Sales">
<Domain ID="01" Name="Production">
<Domain ID="01" Name="Inventry">
<Domain ID="01" Name="Stock">
</Domains>
How to load all the domian names in an arraylist
I have written the follwoing code, but it is not working
XmlDocument xmlDoc=new XmlDocument();
xmlDoc.Load(filename);
XmlNodeList domainNode;
domainNode=xmlDoc.GetElementsByTagName("Domains");
ArrayList aList=new ArrayList();
for(int count=0;count<domainNode.count;count++)
{
if(
aList.Add(domainNode[count].FirstChild.Attributes[1].Value.ToString());
}
But it is giving error, not adding all the domin. Can anyone help me please.
kesavan
|
|
|
|
|
Your XML looks a bit dodgy :p
The 'Domain' element is not properly closed.
|
|
|
|
|
Short
-----
I need to catch an OnCheckChanged from a gridviews' checkbox that gets filled by a DataTable.
Long
----
I have an ASP.net page with C# codeBehind.
In it is a gridView that gets filled by a DataTable.
There happens to be a bool in one of the columns.
I want the user to be able to check or uncheck these checkBoxes. But there is no onCheckChanged listener exposed on the CheckBoxField control.
The CheckBox looks like this:
<asp:CheckBoxField HeaderText="permission" DataField="permission" ReadOnly="false"/>
I thought I could go for an ItemTemplate column like this:
<ItemTemplate>
<asp:CheckBox ID="permissionCheckBox" runat="server"
OnCheckedChanged="permissionCheckChanged"/>
</ItemTemplate>
But this column doesn't get it's data from the DataTable, so I tried to fill it manualy with the OnLoad event OnLoad="loadPermissionCheck" but this doesn't seem to get triggered.
Hope I made myself clear enough.
If this post happens to fit better in the ASP.net corner, then please move it. I wasn't sure.
-- modified at 7:45 Wednesday 30th May, 2007
|
|
|
|