|
I am using an iterator, which iterates through the xml file and reads each node.
Can I access an element directly if it has an unique name?
|
|
|
|
|
Yes you can if you know the XPath to it one example of doing this could be something like -
<code>
XmlDocument doc = new XmlDocument();
doc.LoadXml("<root><element1/><element2/></root>");
/*DocumentElement is always the root element of the xml and the parameter supplied in the selectSingleNode method is the XPath*/
XmlNode node = doc.documentElement.selectSingleNode("//element2");
</code>
|
|
|
|
|
I got a listview that is in details mode, and I want to have a changeable line that is a property of listviewitem. Or something like that...
It don't have to be a listview, it only needs to do what I described above...
Niklas Ulvinge aka IDK
|
|
|
|
|
hi there,
i just wondered if it is possible to "host" a .NET WebService withing a WinForms Application ( and not as ASP.NET stuff in IIS).
I know this is no Problem in Java and i´d like to know if i can do this with C#.
we´re developing a business software and we want our WebService in our Application (encapsuled in a Plugin). well...is this just possible?
i tried to just let my class inherit from System.Web.Services.WebService but i have no idea how to access this "WebService" Object.
any ideas? thanks
jkersch
|
|
|
|
|
You have to host ASP.NET in your Windows Forms application because this provides the services that a .NET Web Service uses. In fact, Visual Studio 2005 no longer requires that IIS be installed to develop Web Forms and .NET Web Services because it has a separate process that hosts ASP.NET. See the System.Web.Hosting namespace[^] for details.
Once you've hosted ASP.NET you can do just about everything you'd do when hosted from IIS. Keep in mind that IIS does provide some services, such as setting up and tearing down hosts for ASP.NET, handling hung hosts, etc. You could, of course, make your host do that but you'll need to implement it.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am getting an unexpected OutOfMemoryException when I try to dynamically allocate a large 2 dimensional array. This array requires upto 1 gig of memory. I have 4 gig installed on this XP Pro machine.
My C# code is listed below:
//-------------------------------------------------
NumToBurst = 100;
NumberOfPixels = 2048 * 2048;
try
{
BigImageBuf = null; // de-ref mem from prev alloc
GC.Collect (); // free up mem from prev alloc
BigImageBuf = new byte[NumToBurst, NumberOfPixels * 2 ];
}
catch
{....
//------------------------------------------------
During execution the NumToBurst variable varies from 10-120. The OutOfMemoryException is generated when the NumToBurst value is greater than 92.
No problems with smaller values.
Help!
|
|
|
|
|
With the code you've submitted, there is no problem. I was able to reproduce this on a 1GB machine with a 2.5GB swap file and get it to work to NumToBurst = 169, which works out to be 1.4GB. The entire array went straight to the swap file when it was created. I'm not even calling GC.Collect, which is unncessary in your case, based on what I've seen so far. I think your problem is because of a 2GB limit for any one process. You might want to see this[^] for a bit more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible to create a property which shows a small button (like font picker) and when the button is clicked a new form is loaded ?
|
|
|
|
|
Piovra_ wrote:
Is it possible to create a property which shows a small button (like font picker) and when the button is clicked a new form is loaded ?
Yes[^]
Share and enjoy.
Sean
|
|
|
|
|
Hey everyone.
I'm really hoping someone can help me with my problem.
I have an mdicontainer application form. The child forms are opened by double clicking on nodes in a tree control. The default way for a child form to open is not maximized...so when I open one form (not maximized) and then open a second child form (also not maximized), things work fine. However, if I open the first child form and maximize it, then open the second child form (which automatically tries to open maximized), I get an OutOfMemoryException that tells me it can't create the window handle. I stuck a breakpoint in the Load event of the child form and it is never reached. The exception is thrown as soon as it reaches the Show() method of the child form. Please Any ideas? This is driving me crazy.
|
|
|
|
|
This isn't normally a problem at all. What does your code look like thats launching these forms?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, I just figured it out. Weird...I should have realized when people were telling me that the OutOfMemoryException wasn't always helpful. I have a panel on that form that I'm catching the resize event for. I didn't know that the resize event for the panel would be caught before the Load event for the child form. I was trying to use something that hadn't been initialized yet because it was initialized on Load. So it should have been a null reference exception instead of out of memory.
Thanks for your reply and your willingness to help.
|
|
|
|
|
You probably got the OutOfMemory problem because the window handle for the object your messing with wasn't created yet. Handle problems will normally be thrown in the OutOfMemory exceptions.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I was trying to find the solution to my problem, but it seems there are no sources to whatever I am facing. Here it is:
I wanted to build a report using Crystal Reports, but my dataset has 120 columns by N records, and in Crystal Reports I can't increase the paper size to whatever I want, so 120 columns don't fit. So now I am trying to build my own report, by adding columns and rows at run time and passing it to a reportViewer. Anyone knows how to do it?
Help will be greatly appreciated.
Thank you.
|
|
|
|
|
120 columns? Who on earth is going to read this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is this any of your concern who is going to read it!? If you don't the answer, don't f***ing reply!
|
|
|
|
|
Is this any of your concern who is going to read it!? If you don't know the answer, don't f***ing reply!
|
|
|
|
|
I only asked because I have NEVER seen a "report" that wide. I've worked in many an industry, and nothing I've seen, or heard of, even comes close to that number of columns. I don't know anyone who would put up with that many columns simply because it's too hard to get to any specific data.
Who wants to look acrossed a report that needs to be printed on drafting D-size paper? That's why I questioning why you even need something that big. Have you actually sat down with anyone who is going to read this? Have they specifically requested something so cumbersome? A report is a summary or filter of data. What your doing sounds more like a table dump.
If not, hav you thought of implmenting a system where-by user can pick the columns, or groups of columns, that they need in the report?
zaboboa wrote:
CAN ANYONE HELP ME?!
If you don't know the answer, don't f***ing reply!
Not with that attitude...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The number of periods will reflect 10 years of Land Development Project. Which actually takes much longer in length. So to your information 120 column report is actually a consice version.
-- modified at 7:46 Wednesday 28th September, 2005
I will use Excel to export the information, no need for Crystal Reports.
|
|
|
|
|
I work with c#.net and i need a obfuscator to Cryptography the code of the projects, for nobody can read the code using a reverse engineering.
i would like to know which is the best obfuscator?
Thanks Junior Lopes
|
|
|
|
|
Not possible. There is no such thing as an obsfucator that stops people from reading your code - the .NET framework needs to be able to read it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
so i can not protect my code, i mean if i do a small project and i want to sell this project, and then somebody can read my code? i can not hide or crytography ? how does the companies do ?
|
|
|
|
|
You can use C++, otherwise, you just have to hope for the best.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You cannot prevent that your code is being read, but you can make the decompiled code harder to understand by using an obfuscator. Obfuscators rename all classes and methods, which makes guessing what the code does much harder.
You can also use Salamander Protector to compile .NET assemblies to native code, but it's expensive...
|
|
|
|
|
Be aware that even compiling into native code won't stop a determined hacker from being able to bypass your regisitration routines. Ultimately whatever you do your code will be turned into x86 assembly, and it's execution can be monitored in a debugger. This is why even though game companies spend millions on copyprotection cracked versions are out within days.
|
|
|
|