|
Maybe it is a good idea to use the SOAP serializer first for debugging purposes. It is easier to review to XML then. It is not very difficult to switch back to the binary serializer once it all works.
|
|
|
|
|
with the soap formatter I have one problem. If I serialize my object then I get a NullReferenceException. The problem it seems that it is a DateTime field. If this field is not inside the class (other data are strings) all works fine.
Do you have any idea?
Best regards
Hansjörg
|
|
|
|
|
I'm not very experienced with this topic. A NullReferenceExpetion means that soemthing is wrong with an object. Likely causes are that you forgot to assign memory (using new) or maybe you try to use an object that no longer exists. Best way to solve this is stepping through the suspected code using the debugger and checking the object values.
|
|
|
|
|
I have checked it...the object that gives the exception is a DateTime value...and this value is okay. I have no idea why...
Best regards
Hansjörg
|
|
|
|
|
I saw you posted this question in another post. There you mentioned other parameters. Did you check these as well? Also check all other variables you use. Somtimes these errors really are obscure, but it is almost certain you did something wrong. You also may try slight code variations, just to see if these work. Fi replace parameters with constant values, replace the datetime by anonther type of object etc. Just keep trying. It may take you two or three days before you find out.
|
|
|
|
|
I have tried a lot of things and now I have found out the problem. For coding I use c++/cli and there it seems that it is not possible to use the DateTime^, but you have to use DateTime...
Best regards
Hansjörg
|
|
|
|
|
I have seen some funny stuff when closing MemoryStream , remove those .Close() for now. If that is the problem, what does work is placing it in a using block.
|
|
|
|
|
It doesn't help...
With the XmlSerializer it works...(but there I have a problem with the DateTime..I have to set there the XmlIgnoreattribute
Best regards
Hansjörg
|
|
|
|
|
as in subject. And put in into array string.
Training makes perfect....
|
|
|
|
|
Hello,
System.IO.Directory.GetFiles method helps you here.
I returns an array of Filennames.
All the best,
Martin
|
|
|
|
|
thanks Martin.
It really help me. I got all what i want from that.
Training makes perfect....
|
|
|
|
|
Glad I could help!
All the best,
Martin
|
|
|
|
|
Need to write a windows service which reads the mails stores on exchange server and should store into local database.
can any body describe with example,
please urgent
thanks in adavance....
Rahul
|
|
|
|
|
Hello.
Before I describe my dilemma, here's my code, roughly:
List<arraylist> allEntries = new List<arraylist>();
// fill allEntries with ArrayLists
// each ArrayList entered is at *least* of size 4
// allEntries.Count is 3
for (byte i = 0; i < 2; i++)
{
List<arraylist> goodEntries = allEntries.FindAll(delegate(ArrayList al) { return((byte)al[0] == i); });
// do stuff
} // for
The problem: inside the anonymous function, al[0] sometimes gives the values of al[1]. I need it to only compare the values of al[0], never al[1]. I have seen code where the delegate is an object from a user-created class (ex: (delegate(Cars c) { return(c.plateNum < 123); });).
What exactly am I doing wrong?
Any help or advice is appreciated!
|
|
|
|
|
Why are you using ArrayList at all ?
What is al ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sometimes al[0] is returning the result of al[1], are you sure they are not equal in that situation?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
First, I apologize. My code was not correct, and I'm sure that added to the confusion.
Now, al is ArrayList al, and the reason I need al[0] is to see if two ArrayLists
contained in "allEntries" have the same value stored in index 0.
I have tried it when al[0] and al[1] contain the same values, and when they contain
different values. The result is the same, ie, in the anonymous function, al[0]
sometimes gives the values of al[1].
Here is my code again:
List<arraylist> allEntries = new List<arraylist>();
byte id0 = 0, id1 = 1;
byte sid1 = 16, sid2 = 88, sid3 = 100;
ArrayList entry1 = new ArrayList();
ArrayList entry2 = new ArrayList();
ArrayList entry3 = new ArrayList();
entry1.Add(id0);
entry1.Add(sid1);
entry1.Add("John");
entry1.Add("Doe");
entry2.Add(id1);
entry2.Add(sid2);
entry2.Add("Jane");
entry2.Add("Doe");
entry3.Add(id0); // notice index 0 of entry3 and entry1 contains id0
entry3.Add(sid3);
entry3.Add("Joe");
entry3.Add("Doe");
allEntries.Add(entry1);
allEntries.Add(entry2);
allEntries.Add(entry3);
for (byte i = 0; i < 2; i++)
{
List<arraylist> sameIdEntries = allEntries.FindAll(delegate(ArrayList al) { return((byte)al[0] == i); });
// do stuff
} // for
Any help is appreciated!
|
|
|
|
|
I have an ObjectDataSource bound to several columns including a read-only ID column. I am overriding the OnUpdating event and if I look at all the InputParameters everything is good but my ID column is null.
Is there anything special you have to do with a read-only column to get it to capture it and send it to my Update method?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
Can you send a bit of your code, I am not exaclty sure what you are trying to so.
Cheers
|
|
|
|
|
I got it. I was trying to get the value of a field on a gridview to get it passed to my ObjectDataSouce. I just found the selected row of my gridview grabbed the DataKey and did it that way.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
This should be easy but I can't work it out (nor follow the logic).
I have a comboBox that has its text bound to a field in a datatable. The items in the dropdown list are hard coded.
I have a Save button that has the following on_click event:
<br />
try<br />
{<br />
this.configBindingSource.EndEdit();<br />
this.configTableAdapter.Update(this.myWebDataSet.Config);<br />
this.myWebDataSet.AcceptChanges();<br />
MessageBox.Show("Changes recorded successfully.", "Information Only", MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
setLogLevel();<br />
logger.Info("SaveButton_Saved");<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show("Unable to record the change.\nPlease try again.\nSee log file for details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);<br />
logger.ErrorException("SaveButton_Failed", ex);<br />
}
Any changes in the comboBox are succesfully saved when the Save button is clicked.
There are no other databound controls on the form.
What I wish to do is eliminate the Save button and have the above events inside the Save click take place automatically. I thought I could just move the Save button events into the comboBox's SelectionChangedCommitted event but this doesn't save the changes back to the datatable/database. I even tried putting tsButtonSave.PerformClick() into the comboBox's event but that doesn't work either.
Can someone help me with the solution and perhaps explain to me where my logic is flawed.
Thanks.
Glen Harvy
|
|
|
|
|
Hello,
Glen Harvy wrote: move the Save button events into the comboBox's SelectionChangedCommitted event
Glen Harvy wrote: into the comboBox's event
Do this event's get fired?
Have you debuged it?
All the best,
Martin
|
|
|
|
|
"\" this is coming in my Xml output.I want eliminate this.
I am writing code in C# using StringBuilder class and XMLTextWriter.
Any Properties or Method's are there to eliminate this.
|
|
|
|
|
It's hard to work out what your problem is. You want to lose the slash ? Where is it ? Why do you need to lose it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't want the special character.I need everything except special character.But incase of attribute where this = sign is there these special chracter is coming.
|
|
|
|