|
Very new to XML. What do I do to compensate for the - s? WHEELS
|
|
|
|
|
it is not valid XML as long as those hyphens are there. Eradicate them.
|
|
|
|
|
|
Isn't that what I told you, too?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi John.
I believe you did. Having a very challenging time with this XML/WebService, and didn't expect to enough these hypens.
Thanks again.
WHEELS
|
|
|
|
|
I'm working on a project as we speak that's getting XML from a SQL database stored procedure via a web service, and I'm not getting any hyphens. Can I assume you solved your problem?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Found a work around, although not as elegant as I would like:
Bank.net.webservicex.www.USZip ws = new Bank.net.webservicex.www.USZip();
XmlNode cityNode = ws.GetInfoByZIP(txtZip.Text);
string cityName = "UNKNOWN";
string stateName = "UNKNOWN";
foreach (XmlNode node in cityNode)
{
foreach (XmlElement elem in node)
{
if (elem != null && elem.Name.Equals("CITY"))
{
cityName = elem.FirstChild.InnerText;
}
if (elem != null && elem.Name.Equals("STATE"))
{
stateName = elem.FirstChild.InnerText;
}
}
}
txtCity.Text = cityName;
txtState.Text = stateName;
WHEELS
|
|
|
|
|
HI everyone, I have an application in VSC++/CLI and this is how I request data from the device.
serialPort->Write(String::Concat("P", Char(4).ToString(), Char(54).ToString(), "@"));
P = first Character and
@ = is the last Character.
Char(4) is the number of arguments.
Char(54) is the packet number for example.
my device knows what to send when I ask this.
My question is how do I do the same in C#.
thanks
|
|
|
|
|
This[^] article should help. Also see the String [^] class.
/ravi
|
|
|
|
|
Hi,
you could do exactly the same thing in C#, however I would prefer using a byte array, as not all data items are textual:
byte[] request=new byte[] {(byte)'P', 4, 54, (byte)'@'};
mySerialPort.Write(request, 0, 4);
|
|
|
|
|
Hi Luc Pattyn, I am trying it now then I will let you know if it works.
thanks much.
|
|
|
|
|
Hi Luc Pattyn, I am still have problem with the serialPort communicaiton.
I can send request to the device and device is responding but I don't get
any data back. I know the the device is sending data because my other
program shows it.
c# application getting no data don't know why.
if (serialPort1.IsOpen)<br />
serialPort1.Close();<br />
serialPort1.Open();<br />
byte[] request = new byte[] { (byte)'P', 4, 40, (byte)'@' };<br />
serialPort1.Write(request, 0, 4);<br />
textBox1.Text = serialPort1.BytesToRead.ToString();
|
|
|
|
|
your target device needs some time to react to the command you send it. It has to:
- get aware there is some data coming in;
- interpret the command;
- execute the command;
- send a response.
The last step probably is the slowest: at 9600 Baud each character takes around 1 millisecond, so a string of 10 characters is in transit for 10 milliseconds. Not a single character will be received in zero time, which is what you allowed for.
Normally serial data is received in an asynchronous fashion, either using the DataReceived event, or by having another thread performing a Read() ahead of time.
As a first experiment, insert a Thread.Sleep(100); right after your port.Write statement.
|
|
|
|
|
First; I wouldn't use Concat -- I never have. I'd use either String.Format or let the serialport class do that.
Second; Why do you have Char(4).ToString() and Char(54).ToString() ? Can't they be stored in constants? e.g. const string Char4 = "\u0004" ;
|
|
|
|
|
hi PIEBALDconsult, this is how I found it to work don't know why I use it. The application I have this is how it is used and work fine. But now I have to make the same application work on a different platform where C# is used. I am trying to use same mechanism on C# application and I run into problems.
thanks for your reply.
|
|
|
|
|
Hi,
when you enter some festivals, you get the program of this festival on your cellphone when your Bluetooth is on.
Now I want to write a similar application that broadcasts a text message to all the devices in the surroundings of my laptop. Has anyone here some experience with Bluetooth and sending text message over Bluetooth?
I've found this library of 32feet, but I don't know if it is any good...
let met know!
|
|
|
|
|
Since nobody seems to understand my question, i will specify it.
Does anyone here has any experience with Bluetooth and mobile phones?
I would like some advice about the libraries I could use or maybe that I should write the entire communication myself.
let me know
|
|
|
|
|
Hello I am making http calls from my C# desktop application.
I want to use Gzip compression while posting data and also deserialize the server response that is in GZip compression. Any help for that.
|
|
|
|
|
Try using the GZipStream class.
|
|
|
|
|
Do not forget to modify the content type of the http header in order to correctly handle it on the server side or client side.
|
|
|
|
|
Is it possible to get UNMANAGED stack trace in c#. Here is what I am trying to do:
I have a COM written in c#. I have VB6/C++ code calling this COM component. In the COM component, I want to be able to find out who called the COM function(s).
I have tried using the System.Diagnostics.StackTrace class, but that seems to only return MANAGED stack traces.
For Example:
COM Interface/Implementation
<pre>
[Guid(###)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISkel
{
[DispId(1)]
void DoSomething(int id);
}
[Guid(###)]
[ClassInterface(ClassInterfaceType.None)]
public class Skel : ISkel
{
public void DoSomething(int id)
{
...
}
}
</pre>
VB (VBProject Name = VBProject1)
<pre>
Private Sub Command1_Click()
dim s as new Skel
s.DoSomething(1)
End Sub
</pre>
From the C# code, I want to get a value indication that the calling project (VBProject1) and the method (Command1_Click())
Any ideas/suggestions?
Thanks in advance.
|
|
|
|
|
AFAICT, the StackTrace will only work with managed calls. I can't find any method of getting the unmanaged stack trace from managed code.
|
|
|
|
|
You cannot view unmanaged code in the stack trace - you could use the disassembly window, however.
|
|
|
|
|
I have created a dump of an excel addin and I'm having trouble loading it. When simply opening it with Visual Studio 2008 it gets to run after it loads the symbols but the "go to source code" button is grayed out.
Second time I run it it throws the no source code error however I have specified the source code directory.
I'm afraid that being an Excel addon I also need to have the excel sources?
|
|
|
|
|
Hi,
I was wondering is there some kind of addon for Visual Studio that lets you develop excel sheets or addons with C#.
Anyone have any links?
Thank you in advance
Regards,
Christian Pace
|
|
|
|