Sorry, kind of late here and I'm probably not thinking straight, but
could you try changing the web service to accept a byte array instead of
a string?
Use Encoding.Unicode for conversion to and from a string
--
Alex Feinman
---
Visit
http://www.opennetcf.org
Hey
Tried to do the messagebox trick just before calling the webservice. At
that point the text is ok.
Then i tried to do the messagebox trick in my webservice (well, not
exactly a messagebox, but i wrote it to a filestream). When i do that
as the first thing in my webservice, i can see that it has cut of the
"\r". So i guess the problem is in the transfering of the variable to
the webservice.
Now im totally lost.
How do i fix this?
Thanks so far
--
Jimmy
"Alex Feinman [MVP]" <
[email protected]> skrev i en
meddelelse What does your web service look like?
--
Alex Feinman
---
Visit
http://www.opennetcf.org
Thanks
Used the MessageBox.Show instead of the debugger. Found that easier
Ok, so now i can see that it actually only writes the "\n".
I can update this field from the web wich i use to input test data.
So
everytime i want to start over i just fill in the testdata from
there. After
having done that i start the application on my pocket PC again. When
i load
these values it actually says "\r\n". Then i save the exact same
data,
without touching anything, from my Pocket PC. When i reload the
values into
my Pocket PC application it only says "\n". Now isnt that weird?
Do you, or anybody else, know why this is happening?
It seems like its not saving the "\r"-part of my text???
Thanks so far for your help. Really appreciate it.
--
Jimmy
"Alex Feinman [MVP]" <
[email protected]> skrev i en
meddelelse
Add to your code
byte[] bytes = System.Text.Encoding.Unicode.GetBytes(s); // s is
your
string
and examine the bytes in the debugger. Check if the line breaks are
00 0a
or
00 0d 00 0a
Alrternatively you can output the hex string using
MessageBox.Show(BitConverter.ToString(System.Text.Encoding.Unicode.GetBytes(
s)));
--
Alex Feinman
---
Visit
http://www.opennetcf.org
It is multiline.
I dont know how to check wether it is "\r\n" or just "\n". Can you
give
me
any hints on that?
Thanks so far
--
Jimmy
"Alex Feinman [MVP]" <
[email protected]> skrev i en
meddelelse
Make sure that the textbox where you put the text retrieved from
the
web
service is multiline. If this does not help, check that the text
received
back still has "\r\n" as line terminators and that they are not
reduced
to
"\n"
--
Alex Feinman
---
Visit
http://www.opennetcf.org
Hey
Im writing text in a multiline textbox. Im pressing a button
wich
results
in
a call to a web service that saves the data in MS SQL Server as
ntext.
At
another point in my application i do a select on this ntext
field and
then
i
want that text to go into the same multiline textbox.
My problem is that when i write out the text it puts out a lot
of
squares
in
the text where there should be a new line.
textBox.Text = DS.Tables[0].Rows[0]["ntextfield"].ToString();
But if i instead write out the text in a messagebox everything
looks
just
fine.
MessageBox.Show(textBox.Text);
What am i doing wrong here?
Please help.