|
|
This is my XML input:
<authentication xmlns="Authentication">
<userid>testUser
<password>password
<mode>2
This is my XML Schema Input:
<xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Authentication"> <xs:complextype> <xs:sequence> <xs:element name="UserID" type="xs:string" minoccurs="1"> <xs:element name="Password" type="xs:string" minoccurs="1"> <xs:element name="Mode" type="xs:int" minoccurs="1">
ItsMe
|
|
|
|
|
xmlStream = new FileStream("input.xml", FileMode.Open);
xsdStream = new FileStream("input.xsd", FileMode.Open);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(xmlStream );
xmlDocument.Schemas.Add(null, XmlReader.Create(xsdStream ));
xmlDocument.Validate(new ValidationEventHandler(this.ValidationHandler));
private void ValidationHandler(object sender, ValidationEventArgs e)
{
}
"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
|
|
|
|
|
I tried the function but
xmlDocument.Validate(new ValidationEventHandler(this.ValidationHandler));
is not calling the below function.
private void ValidationHandler(object sender, ValidationEventArgs e){// Do something}
Is there anything else to be done to link the eventhandler with the below function
ItsMe
|
|
|
|
|
am i supposed to register the event . if so how to do it
ItsMe
|
|
|
|
|
No, there's nothing more to do. The code works perfectly in my application.
Note that the event handler only gets executed if your xml file is invalid wrt. to the schema.
"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
|
|
|
|
|
Thanks Its working fine
ItsMe
|
|
|
|
|
How to implement Soap Exception class in web service methods
ItsMe
|
|
|
|
|
What do you mean with implement. If you need to throw such an exception just do it:
throw new SoapException();
"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
|
|
|
|
|
I guess if i use soap exception class i can customize and output the error message in XML tag. I can also customize the error message through soap exception class. Can u give me a simple example.
ItsMe
|
|
|
|
|
How to use "The Message property of the original exception" which is a property of soap exception class.
ItsMe
|
|
|
|
|
hi
what is binding source in vs2005 and why oledb and sqldataadapter does not exist in vs2005 ?
please help me how to use they in vs2005 and how to use ado 2005 ?(with source code or tutorial)
|
|
|
|
|
that is not possible that there is no oledb and adapters in vs2005... did you check the System.Data.OleDb namespace?
if not try adding the refferance to it to your project (it might not be there?).
and if still not yuo have a problem in your .NET framework or VS2005
|
|
|
|
|
thanks ..
i know this but i want to add oledb and sqldataadapter in design time ..
|
|
|
|
|
oh, then go to the Data tab and choose "choose items", sort it by namespace and you can add all your "troubles" in design time as you would like
|
|
|
|
|
I have a small application that i've made. It runs in the system tray. I'm facing a wierd problem. When I try to shut down Windows XP. All the applications exit except mine. I have to manually close my application using the task manager and click the shutdown button again. only then does XP shut down. What could be the cause of this? Is it because I havent wriiten code for window messages such as WM_SHUTDOWN?
|
|
|
|
|
You are probably handling the Closing event of the form. Use Environment.HasShutdownStarted to test.
|
|
|
|
|
Bingo! It worked. Thanks, leppie.
|
|
|
|
|
How to block popup window in axWebBrowser?
|
|
|
|
|
In the event axWebBrowser1_NewWindow2 just need to put below code
e.ppDisp = null;
e.cancel = true;
return;
|
|
|
|
|
I am desparately trying to get my apps forms to load acceptably fast before release to users. I thought C# was suppose to be comparable to C++ in speed? It seems more like VB6 is a better comparison! I wish i knew the real deal before starting this project! I was lulled into a false sense of security when i kept reading about miracles on the internet about dramatic increases in performance with little tweaks. I thought a solution would come along sooner or later.
I am developing in NET 1.1. My computer is 1GHz Sony Laptop Windows 2K.
Description of my forms:
Combination of custom controls, forms, and user controls. By using panels and user controls as subforms, forms are up to 3 levels deep. Form have about 10-30 controls each on them. Controls used are stock labels, buttons, checkboxes, radio buttons, textboxes. Some forms have customized listviews and combos inherited from stock controls. All forms have button icons.
What i have done:
I have used the double buffering control style with AllPaintingInWmPaint and UserPaint in the forms, user controls and custom controls where i could. Code is in the constructor. I am using SuspendLayout, ResumeLayout to wrap control setup code that is outside the InitializeComponent method. It is called either in the constructor or Form Load. I tried precompiling assemblies. No performance gain there.
Double buffering slowed form load down but improved the sluggish drawing. Sluggish drawing persists. To describe, drawing of forms seems to be done in pieces, not all at once. Overall, the perception of loading has improved a notch, BUT NO MORE THAN A NOTCH! I will note that once the form loads the first time, future access during program excution is fast. It seems form graphics are cached by the CLR. But that first time loading! Ouch!
What can i do?
|
|
|
|
|
Startup time is always expensive in a managed environment. At many points .Net performance is comparable to C++ performance but startup time definitely isn't.
First of all you could use NProf[^] to profile you startup phase.
Second have a look at nGen. It generates native images of your assemblies and stores them. Thus on startup the CLR doesn't have to compile everything.
Third... well depends on your form. Having too many controls (also nested) might naturally slow down performance. I can't give you any good advice on this because therefore I would need to know some details.
|
|
|
|
|
What's the file-size of the graphics?
Have you tried NGEN.EXE[^]?
I are Troll
|
|
|
|
|
hi guys !
need some help
i have to find out the file paths between string which has to be taken from User from a richtextbox
the problem is there is no specified location on which the user will type the path .. it can be any where in the string
for eg.
user entered data something like this :
If the above link is not visible then run the application "C:\Program Files\CasinoOnNet\Unwise.exe" and follow the instructions to uninstall the Casino on Net.
i have to find “C:\Program Files\CasinoOnNet\Unwise.exe” in this string.
these paths can be more than one and it is not necessary that they are in Quotes..
is there any way to find such paths ..
any idea
abhinav
|
|
|
|
|
A simplistic approach that (may) provide reasonably good results is:
search for the first occurence of a backslash character (\);
if (found) {
rewind to first previous space;
extract substring to next space (or end of string);
in source string, replace substring with empty string;
return substring;
}
return "";
PS: This is highly NOT a perfect solution. In particular, it won't properly handle paths containing embedded spaces.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|