|
Hi,
Just happened to see that same error yesterday...
check out this link http://www.codeproject.com/useritems/RemotingEvent.asp
Section solution 2.
When you implement a wrapper class which can be accessed from both client and server side you app should work
Greetings
Kaine
|
|
|
|
|
Hi.
This is because of the remoting security. Normally types that are in GAC-registered assemblies are allowed to be serialized and deserialized, unless they're derived from:
- System.Runtime.Remoting.ObjRef
- System.DelegateSerializationHolder
- System.Runtime.Remoting.IEnvoyInfo
- System.Runtime.Remoting.Lifetime.ISponsor
you have to set the typefilterlevel to "Full" in your channel-configuration.
for more information take a look at this: http://msdn2.microsoft.com/en-us/library/5dxse167(vs.80).aspx[^]
greets
m@u
|
|
|
|
|
Dear all,
Probably is the answer pretty obvious, but I have been struggling with this for the past 2 days already, and it's making me frustrated.
I got following XML file
<br />
<?xml version="1.0" encoding="ISO-8859-1"?><br />
<things><br />
<people><br />
<person id="1"><br />
<name>Bob</name><br />
<age>25</age><br />
<projects><br />
<project x="123" y="123">ABC</project> <br />
<project x="53" y="149">DEF</project> <br />
<project x="13" y="111">FOO</project><br />
<project x="463" y="435">BAR</project><br />
</projects><br />
</person><br />
<person id="2"><br />
<name>Steve</name><br />
<age>100</age><br />
</person><br />
<person id="3"><br />
<name>Maria</name><br />
<age>23</age><br />
<projects><br />
<project x="1" y="1">HOT</project> <br />
</projects><br />
</person><br />
</people><br />
<file><br />
<name>filename.ext</name><br />
</file><br />
</things><br />
How can I add in C# a new person, and acess the "people" node.. I even cut away so much code, that I ended up with following, just to print out what's in there, and it even fails:
<br />
doc = new XmlDocument();<br />
doc.Load(this.filename);<br />
XmlElement rootPeople = doc.GetElementById("people");<br />
XmlNodeList node = rootPeople.GetElementsByTagName("person");<br />
for (int i = 0; i < node.Count; i++)<br />
{<br />
Console.WriteLine(node[i].InnerXml);<br />
}<br />
I have been messing with Xmlnodelists, xmlelements, xmlwhatevers, but even after reading the first 2 pages of google results, it still doesn't seem to work..
Can somebody point me in the good direction?
Thanks,
mike
|
|
|
|
|
First of all, I suggest using the SelectNodes and SelectSingleNode methods instead of GetElementsByTagName since both use XPath expressions and therefore allow specifying/restricting the selection in more detail. You can for example select the (first) people node by writing
XmlNode peopleNode = doc.SelectSingleNode("//things/people");
To create a new person or more general new nodes in a XML document take a look at this Create New Nodes in the DOM[^].
"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
|
|
|
|
|
Thank you Stefan, works like a charm!!
Seems that, after reading your signature.. the universe is building improved versions of me
Thanks again.
|
|
|
|
|
I have a problem like Yanshof.
I have a class writed in C++ (I don't want to translate it), it is used to store and processing te data...but the interface of the program must be writed in C# (or VB).
It is possible to do this in a simply way (using Visual Studio 2003 .NET?) ?
How to create this solution that contains this classes in different lenguages.
Y/N ?
If yes, does anyone can show me the way, I need only a simple example (the classic "hello word" in mixed lenguage is enough)
Thanks a lot
Cheers,
Russell
|
|
|
|
|
A very simple way is to set some of your procedures written in C++ as exports. And using DllImport attribute in C# you can use those exports
Do your best to be the best
|
|
|
|
|
First, thanks you for your reply.
Yes, of course, using dll I can export the 'procedures',.... but this is not exactly what I need: I need to use an entire class, his member functions and (expecially) his member variables.
I am hoping that it is possible to create a unique Visual Studio solution composed by 2 sub-solution, one (written in C++) that contains the document and the other (written in C# or VB NET) to visualize this document.
But, unfortunatly, I'm going to think that it is not possible, nobody is confirming this 'dream' to any of my posts.
Let me know
Cheers,
Russell
|
|
|
|
|
Use the Form.Closing event for this where you can set the CancelEventArgs to decide if the form will actually close. However I don't think that works if you end the process via task manager.
|
|
|
|
|
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
When you close it with taskmanager from the Applications menu, this event is also fired, but not when you close the underlying process via the Processes panel.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Thanks joon_
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks a bunch szukuro, although I've made a mistake and deleted my post cuz I thought it was a stupid question so forget about it, i've already worked it out so you can delete this post as well otherwise it's orphan without my question!
sorry and thanks szukuro
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: I've made a mistake and deleted my post cuz I thought it was a stupid question
It is more stupid to delete your post!
|
|
|
|
|
there are no stupid questions, only stupid people answers.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
joon_ wrote: there are no stupid questions
Exactly - Someone else could have benefited from the thread if they had a similar problem.
|
|
|
|
|
Colin Angus Mackay wrote: omeone else could have benefited from the thread if they had a similar problem.
True but I cant redo it now, can I ..
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Hi,
I need to load two xsd (xml schema) in one dataSet.
<br />
DataSet dset=new DataSet();<br />
dset..ReadXmlSchema("dddd.xsd");<br />
i want to use something like that but with two schema (in one schema is define the complex type and in one the relation).
|
|
|
|
|
C# 2003
I load the gif image and reduce the image size then
I can save the image there is no probelm but it is not
animated.anybody help me.
Continue...
|
|
|
|
|
|
Hi Friends,
I have a problem may be any one of you guys could help me. I am developing an online watch Movie Website. Here I need a script which can check after every (let's suppose) 5 seconds that whether user exists in database or not. Although I am using c# but I need a solution no limit in which language it is (c#, javascript, vb.net).
I can check it simply to "Refresh" page after every 5 seconds but me and my client don't want this. Once before this I posted same kind of question but still no answer. I hope to get this time.
CHEERS
|
|
|
|
|
I don't believe you. You have a flaming cheek coming here and claiming that you haven't had an answer.
I told you before[^] what you need to do. No, I didn't give you the exact code to do it, but I did tell you how to do it - and that's the most that you should expect of people. We're here to help, not to actually write the code for your client for you. I even gave you the JavaScript that you would need to use to fire the refresh without doing a postback.
Don't come onto these forums and lie about the lack of help you got. Frankly, I'm insulted and disgusted.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Listen Mr.
What do u think If your code works then Am I crazy that I have an answer and I am coming here again and again to insult you? Do we know each other? Ofcourse Not. I am not asking you to write code for me. I tried code which u sent me even then I need to refresh page. One more thing I think this is not your personal forum. This is second time you are replying me in this language. I said you "Sorry" that time as well and saying again. I am Sorry.
if you think I am just insulting you please give me a favour never ever reply next time to my Thread. Thanks a lot.
|
|
|
|
|
No. You listen to me. You have come on here and said that you never had a reply. You did. That is why I am so mad. Time and time again, people have given you answers (and I'm not the only one who has done so). It is insulting to all who have tried to help for you to suggest that nobody has.
If you think that you haven't received enough information then say so. Tell us what you have done to help yourself, and what approaches you have tried. Don't just ignore the work that people have done for you.
You tried the code I sent you. Great. That gave you a starting point to help yourself. You even got pointers as to what else you needed to do, but we expect some level of commitment from you to at least try/research these other areas. Yes - I could give you the code, but what would that achieve? Your client would have code that you hadn't written, and wouldn't know how to maintain. And, all it proves is that I know how to write JavaScript and Ajax. By giving you advice on the areas that you need to look at, you learn something and you give your client value for money.
Yes - this isn't my personal forum. But, I have spent a lot of time on your problems, and I feel that I am justified to feel that you haven't done enough to help yourself. I've given you code/techniques in JavaScript and XML. With the XML I ended up feeling that I was writing your code for you - and that's when I stopped. I come to these forums to help people - and when I feel that my goodwill is being abused, that's when I stop being so nice. If you come up with a new problem that needs looking at, then I'm more than willing to help, but when you trot out the same old problem time and time again because people haven't written out the whole solution for you, then you aren't going to get my help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I said "No Answer" which means my problem is still there not the appropriate answer but you consider it in different way. I am not so stupid to just copy code from you and paste it on my web. I never did this and will never do it in future. I always base on logic not on code. You talked about Ajax I don't know anything about it then how can I use it? I need time for it which I don't have for this project.may be for next one.
I had a problem of converting html tags from webservice. I tried on internet but couldn't find any help. Yesterday I fixed it myself in c#. by using Server.HtmlDecode.
I already tried your sent code and trying it right now.
|
|
|
|