|
i think it will work !!
you will create several xml files according to your array
Tamimi - Code
|
|
|
|
|
|
sathish s wrote: There is no inbuilt way to do this..
Yes there is, the article you linked to uses an XmlSerializer, which is "built-in" or at least comes with the framework!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
J4amieC wrote: at least comes with the framework!
I agree with that, But
I suppose something like dataSet.ReadXml(), DataSet.WriteXml were Inbuilt Methods.
|
|
|
|
|
Yes satish, Dataset has this kind of build in methods. Am looking at similar methods for custom classes.
Well one alternative is using of XMLSerialization as disussed before
Regards
Kais
|
|
|
|
|
Hi,
I am using float datatypes for calculating ratios. Say the result is 3.33333334, i want result only with two decimal points. How to do that?
kumar
|
|
|
|
|
|
|
If you only want to display 2 d.p. use the ToString("f2"). If you want to actually round the result and store the rounded value as a float you can use Math.Round
|
|
|
|
|
Another way to do this when you're converting to a string(if you're displaying it), is you use .ToString(##FORMAT##);, You might want to use "#,##0.##" or "#,##0.00" That displays commas every 3, and (with the first) optionally or forces 2 decimal precision. The optional 2 decimal places removes trailing zeroes(so a ratio of 2.00, will show as 2).
|
|
|
|
|
my question is about IE scripting.
I have 100 notebook client. In Company i have 131.107.2.0 domain.
my proxy server is 131.107.2.7
when employees at work, they can connect to internet using proxy.
But When thay at home, there is no proxy, they have direct internet connection generally.
They cannot connect to net unless they uncheck "use proxy server" at ie properties,connection tab, lan settings part.
So i wantto write a script to prevent this.
I wrote a script but it is not working.
Any idea or where i find any script to do this.
function FindProxyForURL(url, host) {
if ( isInNet(host, "131.107.2.0", "255.255.255.0")
{
return "PROXY 131.107.2.7:8080";
}
else {
return "DIRECT";
}
}
|
|
|
|
|
How about asking in the: Operating Systems / SysAdmin forum, people there might be better suited to this than C# people.
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
|
|
|
|
|
Hi,
My current situation is that: I'm using multicolum comboBox for displaying data in two columns, one for text description and second for its ID number. Now i want to retrieve ID number for the selected item/text. For this, implemented a function that returns ID for selected value. That is main scenario.
Here I need your suggestionS (please!):
1) Should i keep a DataTable for each combobox in memory for getting related data. OR
2) Should connect to database and retrieve required value from it each time when value change in the combo box.
With Thanks and regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
neither!
3) set the DataTextMember and DataValueMember properties then read the SelectedText or SelectedValue property as appropriate.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Thanks.
and
J4amieC wrote: set the DataTextMember and DataValueMember properties
of What?
Since start of this month I'm searching (and trying too) about combo box. Tried different properties but no result. At last i downloaded the article about "Multi-column combox" and started using that custom control, which atleast is displaying required information in columns. Why adopted this method (which is not standrized)? because of
1) time constratint and 2)its my first project in C# -- migrated from VB6.
Although i'm studying too, but obviously it takes time.
According to your suggestion again tried but no result.
Well Thanks alot and
Best Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
J4amieC wrote: set the DataTextMember and DataValueMember properties
Really put me in trouble. These are the web application properties. And i'm working with windows application.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
hai...
i was writing windows service using c#.net.then i got the following error.please give your suggestions
|
|
|
|
|
ratheeshkumar wrote: i was writing windows service using c#.net.then i got the following error.please give your suggestions
I suggest you actually post the error too.
|
|
|
|
|
i want the code for getting hierarchy structure using c#.net
prasanna
|
|
|
|
|
Hy guys I want to serialize to xml a matrix od double bet when I try to do this:
XmlSerializer(typeof(double[,]));
I get a runtime error.
What is the correct way. p.s code snippet will be apprecited
Thank. Mirko
|
|
|
|
|
Convert the double[,] to double[][]
|
|
|
|
|
Thankyou a lot for the answer but for the following code
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(double[][]));
when executed the compiler get the following message:
"The assembly with display name 'mscorlib.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=....' or one of its dependencies. Impossibile trovare il file specificato.
File name: 'mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=....'
=== Pre-bind state information ===
LOG: User = ....
LOG: DisplayName = mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=...., processorArchitecture=x86
(Fully-specified)
LOG: Appbase = ....
LOG: Initial PrivatePath = NULL
Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=....
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: mscorlib.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=...., processorArchitecture=x86
LOG: Attempting download of new URL file:///.../bin/Debug/mscorlib.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///.../bin/Debug/mscorlib.XmlSerializers/mscorlib.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///.../bin/Debug/mscorlib.XmlSerializers.EXE.
LOG: Attempting download of new URL file://.../bin/Debug/mscorlib.XmlSerializers/mscorlib.XmlSerializers.EXE."
|
|
|
|
|
P.S
when I simply write
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(double[][]));
it work perfectly
|
|
|
|
|
Sooorrrrry for the last post but it's wrong
when I write
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(double));
It work well (but don't deserialize the things that I want)!
|
|
|
|
|
The problem that you're having there is definitely weird. It sounds like it's unable to locate the dll it uses for XML serialization. I tried it on my machine and didn't have any problems. Here's the code I used:
double[][] d = new double[2][];
for (int i = 0; i < 2; i++)
{
d[i] = new double[2];
for (int j = 0; j < 2; j++)
d[i][j] = i + j;
}
XmlSerializer xs = new XmlSerializer(typeof(double[][]));
xs.Serialize(Console.Out, d);
This actually did serialize my array without a problem. I would say you might want to try searching the KB articles on Microsoft to see if anyone else has that error. If that doesn't turn up anything, you might want to find someone with an MSDN subscription that can report the error for you.
Logifusion[^]
|
|
|
|