|
Are you certain that the web service is running? Do you have the proper URL and permissions to access the WS? Try updating your web reference... does it work? If not, you either have an incorrect URL or the WS is down. If it does, then make sure the new Web Reference exports such a call. Let me know if you figure it out (or if both the WS responds to the update AND that method is exported).
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
My web service is down too, can you ask them to bring it up while you are at it?
|
|
|
|
|
Hello,
I am having problems with a tree control in a windows form application. Sometime yesterday a typecast that I was using wuit functioning and I can't figure out where the problem started. I have a class that is an extents the System.Windows.Forms.TreeNode class. It adds fine to the TreeControl, but when I go back and try to read the object and cast it as the new class it throws the following exception. What could have happened to make this start failing? I am including the adding and the locating a node. The adding program sometimes throws a duplicate value, which is tested by the FindChildNode before adding it. The FindChildNode is the biggest problem right now and is throwing the following Exception (Bolded line is throwing the error).
Message="Unable to cast object of type 'System.Windows.Forms.TreeNode' to type 'InternalApp.ECDTreeNode'."
<br />
public class ECDTreeNode : System.Windows.Forms.TreeNode<br />
{<br />
.<br />
.<br />
.<br />
public ECDTreeNode FindChildNode(string cText)<br />
{<br />
ECDTreeNode ret = null;<br />
for (int i = 0; i < Nodes.Count; i++)<br />
{<br />
ECDTreeNode tn = (ECDTreeNode)Nodes[i];<br />
if (cText.Trim().ToLower().CompareTo(tn.Text.Trim().ToLower()) == 0)<br />
{<br />
ret = tn;<br />
break;<br />
}<br />
}<br />
return ret;<br />
}<br />
}<br />
public void AddSorted(ECDTreeNode tn)<br />
{<br />
bool bFound = false;<br />
try<br />
{<br />
for (int i = 0; i < Nodes.Count; i++)<br />
{<br />
if (tn.Text.CompareTo(Nodes[i].Text) < 0)<br />
{<br />
Nodes.Insert(i, tn.Text.Trim());<br />
bFound = true;<br />
break;<br />
}<br />
}<br />
if (!bFound)<br />
Nodes.Add(tn);<br />
}<br />
catch (Exception e) <br />
{<br />
MessageBox.Show(e.Message, "Exception Error", <br />
MessageBoxButtons.Ok, MessageBoxIcon.Error);<br />
}<br />
}<br />
<br />
}<br />
<br />
Thanks for any help,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
Leo Smith,
What is the collection "Nodes" ?, Is it a collection of System.Windows.Forms.TreeNode or ECDTreeNode?
Regards,
Gareth.
|
|
|
|
|
Nodes is a collection ECDTreeNodes.
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
My bet is that you are unintentionally adding a node somewhere using a string to the collection, instead of sending your pre-created node. Put a breakpoint in on the problem line to see what type the node is, and I bet it is just a TreeNode. Once you see which node is causing the problem, try to trace back to when it was created, and I bet you have a line like "tree.Nodes.Add("Some string")" instead of creating your own ECDTreeNode object, then adding that object. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Leo Smith,
If this was true, why do you need to cast it?, since Nodes[i] would return a ECDTreeNode. Think it might be a good idea to:
Trace.WriteLine("node == " + Nodes[i].ToString());
Regards,
Gareth.
|
|
|
|
|
I think that Leo was saying that the objects are EXPECTED by him to be of his type... I don't think that the collection is actually strongly typed to his objects, though, which is what is leading to the error (I think). I also don't think that type casting an object to it's own type throws an exception, but I can't say that I have ever tried it to find out. Any comments on this, Leo? Is the collection strongly typed to your object, as understood by Gareth, or is it just a TreeNode collection, as interpreted by me?
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Thanks both of you. The trace assisted in finding out that the was no error, since as Jeff suspected, I had added a string (although technically I inserted a string value and not a ECDTreeNode). I was unable to find this error only because I almost never insert a value. I had looked at all my Nodes.Add() calls before I posted. The trace let me know the type was wrong and Jeff's "you are probably adding a string" instead of a ECDTreeNode made me stop and look for something out of the ordinary.
Thanks,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
Glad to be of some help.
Regards,
Gareth.
|
|
|
|
|
I'M A FINAL YEAR STUDENT OF BTECH AND IM QUITE STRUGGLING WITH MY PROJECT THAT IS ON
"""REMOTE DESKTOP SHARING"""
AND IM DREADING CLOSE TO END DATE SO SOMEBODY HELP ME IF COULD ARRANGE A PROJECT OR JUST TELL ME WHERE I COULD GET IT ,PLEASE
|
|
|
|
|
First: Don't shout. It is rude.
ashutosh911 wrote: MY PROJECT THAT IS ON """REMOTE DESKTOP SHARING"""
What does that mean? A project title tells us very little.
If you want help then you are going to have to tell us more about your project and prove that you have at least made an attempt. We will not help you get a qualification if you are not entitled to it. In other words YOU MUST DO THE WORK!!!
|
|
|
|
|
Sounds to me like he doesn't really want help, just someone to give him a .sln with everything he wants, not going to happen. Have a feeling a few more of these are going to pop up on these forums (dissertation/final year project deadline time) this time of year.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
ashutosh911,
Start -> All Programs - Accessories -> Remote Desktop Connection. Seems Microsoft did your project for you!
Regards,
Gareth.
|
|
|
|
|
Three things you might want to consider:
1. Stop shouting - ALL CAP is considered SHOUTING and is RUDE!
2. Use a more meaningful subject line next time.
ashutosh911 wrote: """REMOTE DESKTOP SHARING"""
AND IM DREADING CLOSE TO END DATE SO SOMEBODY HELP ME IF COULD ARRANGE A PROJECT OR JUST TELL ME WHERE I COULD GET IT
3. I'll make sure I never hire you for help since you are asking people to help you cheat on your project. Do it yourself and you might learn some valuable skills that cannot be taught by cheating.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
|
Hi all, I am trying to find a way to count lines in an rtf file, so I could later create a kind of paging. I am using c#, also is there a way to show a string that includes format characters (such as "/par" in rtf) in a richTextBox?
Thanks!!!
Panos
modified on Thursday, March 13, 2008 1:59 PM
|
|
|
|
|
panoskatws wrote: Hi all, I am trying to find a way to count lines in an rtf file
There may be a library that will do that for you, I don't know. Otherwise to write your own code to do anything with a specific file format you start by learning the file format. So if that is what you intend to do then go find some documentation for the RTF file format and learn it.
led mike
|
|
|
|
|
Well about libraries I haven't found anything that I can use. So I must create my own piece of code that counts lines and takes specific parts of formated text and display it in a RichTextBox, formated... That is an other problem I have, don't know how to display a part of formated text without loosing the styling(fonts, colors etc.). All special characters are displayed with the text (/n ...). So I understand that I must learn about the rtf file format. Does anyone know the basics that are needed, or any suggestions???
Thanks!!!
|
|
|
|
|
The RichTextbox not working for you?
|
|
|
|
|
It's working fine, but I have a problem with displaying the text formated from a string variable. For example if |I have a string with the following text :"{\rtf1ansi\ansicpg1253\deff0\deflang1032{\fonttbl{\f0\fnil Arial;}}{\colortbl\red0\green0\blue0 ;\red240\green248\blue255 ;}\viewkind4\uc1\pard\cf0\fs40\f0\b\ul Title\par\par\fs24\b0\ul0 This is a test.\cf1 This is a text.\par\par}" how can I display the text formated, without having to figure out all the special characters? Is there any method or function that I can use in visual studio 05?
|
|
|
|
|
panoskatws wrote: It's working fine, but I have a problem with displaying the text formated from a string variable.
Be more specific.
1) Are you having a problem displaying the text with formatting in the RichTextBox control? If so provided details regarding the problem.
2) Are you saying you want to display it in some way other than using the RichTextBox? If so provide specifically how you want to do that.
led mike
|
|
|
|
|
2 ways:
1. Place the string in a MemoryStream, then Load the stream, the RichTextBox should detect it is RTF.
2. Place the string in the clipboard, set its format to RTF, then paste that object to the RichTextBox.
I wouldnt normally suggest a way like #2, but as the 1st method will overwrite all the current content (and that may not be desirable), I do mention it.
|
|
|
|
|
If I understood you correctly, you can set the Rtf property of a RichTextBox to this string and then you can get lines count through Lines.Length .
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
I am having problems with saving listview items into a text file..
Here is my code:
<br />
<br />
StringBuilder sb = new StringBuilder();<br />
<br />
for each (ListViewItem lvi in lstbox.Items)<br />
{<br />
sb.Append(lvi.Text);<br />
sb.Append(Environment.NewLine);<br />
}<br />
<br />
System.IO.StreamWriter sw = new System.IO.StreamWriter(saveSearch.FileName);<br />
for (int i = 0; i < lstbox.Items.Count -1 ; i++)<br />
sw.WriteLine(sb.ToString());<br />
sw.Close();<br />
<br />
But this is only showing the first column header..
I have five colums headers..
How to save all???
Som
|
|
|
|