|
I gotten to the point where i can serialize an xml document using a class.
I just cant figure out how to get a complex type to serialize.
How should my class look if i need something like
<Family>
<Mother>
<Name>
<First>Mary</First>
<Last>Cummings</Last>
</Name>
</Mother>
</Family>
|
|
|
|
|
I think you'd need several classes for that:
class Family
{
public Mother Mother;
}
class Mother
{
public Name Name;
}
class Name
{
public string First = "Mary";
public string Last = "Cummings";
}
If you serialized the Family class, it would result in something like your XML document.
Of course, you'll probably want to use properties instead of public fields.
|
|
|
|
|
This will help you: http://www.codeproject.com/soap/Serialization.asp
|
|
|
|
|
|
Interesting tool at first sight. Does it support inheritance?
Rudolf Heijink
|
|
|
|
|
Building through XSD, yes it does. From straight XML there's no way to specify inheritance. Or were you asking about Pseudo code?
|
|
|
|
|
Hi!
I'm usimg bindingsource filter property to sort out the data I need..
I know that this property supports sql wildcard '%' as a substitution for a array of chars.
is there a wildcard that substitutes only one char??
ex. i've got this list
aaazzz11
aaazzz12
aazzzf13
and i want only those items where three letters counting from fourth are 'z' ie aaazzz11 and aaazzz12
now in sql I'd write "like '___zzz%' "
but '_' doesn't work in bs..
thanks for any help!!
life is study!!!
|
|
|
|
|
namespace validation
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// ArrayList d = new ArrayList(8);
Class1 d;
d = new Class1();
}
}
}
thsi is the form class(winodw form class)
following ios the user defined class
namespace validation
{
class Class1
{
internal protected int h = 0;
internal int i=0;
}
}
i know what is the internal and internal protected
but y bothe the internal and internal protected are being accessed in form1 class
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
internal protected is a superset of internal and protected. Was this your understanding?
|
|
|
|
|
These are access specifiers,
If we use "protected" before a method/variable, it can be accessed only to derived class.
If we use "internal" before a method/variable, it can be access only within the same assembly.
So, internal protected can be accessed within the same assembly as well as in derived class.
Hope this served your purpose.;P
|
|
|
|
|
Hi,
I have two different services; those are running under windows box and Linux box. Both Windows and Linux services had been developed by .NET by the help of respective SDK’s. Both business service systems are running fine based on its scope. But now, I wanted to implement a communication channel or some mechanism, which will help these different services to share objects/data. Apart from that, I am not allowed to use web interfaces to facilitate the communication since both windows and Linux machines resides in same intranet.
Is it possible to communicate between two distinct OS environment using .NET remoting?
If so, what could be the fine tuned way to achieve the same?
What are the other possible thoughts to implement the same apart from remoting and web service?
Any thoughts / url/ sample application will be appreciated.
Thanks in advance.
|
|
|
|
|
Since this will be new territory for many of the people on this forum, please let us know how it turns out. One possibility is for you to write an article about your experiences as you try this.
Phil
|
|
|
|
|
Items[] ItemsArray = new Items[100];<br />
Items[] AlphabetisedItemsArray = new Items[100];
I have an Items array of size 1*100, now lets say i have populated that array, and want to organise its elements in alphabetical order, by item name.
I think the code should be something like this :
AlphabetisedItemsArray = ItemsArray.OrderBy(ItemsArray,Items.getItemName)
If it helps at all, here is the structure of the items class:
public class Items<br />
{<br />
string Name;
<br />
public void SetName(string aName)<br />
{<br />
Name = aName;<br />
}<br />
public string GetName()<br />
{<br />
return Name;<br />
}<br />
}<br />
Any help is greatly appreciated, thanks =)
|
|
|
|
|
|
i ended up doing it manually =)
while (c < NumberOfRecords)<br />
{<br />
<br />
while (index < NumberOfRecords)<br />
{<br />
AlphaItem = AlphabetisedItemNames[c];<br />
NonAlphaItem = ItemsArray[index].GetName();<br />
<br />
if (NonAlphaItem == AlphaItem)<br />
{<br />
AlphabetisedItemsArray[c] = ItemsArray[index];<br />
<br />
c++;<br />
<br />
if (c < NumberOfRecords)<br />
{ index = 0; }<br />
else<br />
{ index = NumberOfRecords; }<br />
<br />
}<br />
else { index++; }<br />
}<br />
<br />
c++;<br />
<br />
}
|
|
|
|
|
Like Kevin said, but you can make it a little easier on yourself by defining a function with a Comparison<Items> signature:
Items[] theItems = ...;
Array.Sort<Items>(theItems, CompareItems);
...
int CompareItems(Items first, Items second)
{
return first.Name.CompareTo(second.Name);
}
|
|
|
|
|
When executing the code -
Environment.GetEnvironmentVariable("USERNAME").ToString(CultureInfo.CurrentCulture)
under the Service Account gives the error -
'Object reference not set to an instance of an object'.
Running the same code using a local machine accounts credentials does not fail.
Pls help me with the possible cause and resolution.
Cheers !
Rajni
|
|
|
|
|
Hi,
when there is no user, what in your opinion should the value be for:
Environment.GetEnvironmentVariable("USERNAME") ??
and who's culture do you want then ?
You should check for null, and maybe work with a default if that makes sense at all.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi All
I want to print a salary slip for the employees in one of my project the slips have to print using DMP printer, How to genrate the print using DMP in C#
|
|
|
|
|
As long as you have the printer driver installed, you can "draw" the slip however you want. And no, I'm not going to write the code for you before you ask.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
I am using Visual Studio 2005 Standard Edition. I know that crystal reports has come in built with this version. But I am unable to view the crystal report template in add new items. How to get that template. Help needed. Thank you.
|
|
|
|
|
Its on 8th number from top in Add New Items, check it.
Imran
|
|
|
|
|
Pick one forum and stick with it. Please read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Lecky, I believe I saw in one of your posts recently that you live in the upper midwest, what state do you live in?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|