comparing strings
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > comparing strings




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    comparing strings  
Dariusz Tomon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-19-05 11:00 PM

Hello

I'm trying to comparing to strings:

1. retrieved from custom xmlplaceholder:
zrodlo = fact.Placeholders["kategoria2"] as XmlPlaceholder;

esc_kat2 = Server.HtmlEncode(zrodlo.XmlAsString);

esc_kat2 = esc_kat2.Replace("<","");

esc_kat2 = esc_kat2.Replace(">","");

esc_kat2 = esc_kat2.Replace("/Zones","");

esc_kat2 = esc_kat2.Replace("/Zone","");

esc_kat2 = esc_kat2.Replace("Zones","");

kategoria2 = esc_kat2.Replace("Zone","");

String kategoria2 has my nationals characters translated into unicode and
looks like this:

"orzecznictwo do celów pozarentowych"

2. The second one is retrieved from SQL database:

selectCmd = "select * from urzond_main order by id";

myCommand = new SqlCommand(selectCmd, myConnection);

myConnection.Open();

myReader = myCommand.ExecuteReader();



while (myReader.Read())

{

kategoria1 = myReader.GetSqlString(1).ToString();

}



String kategoria1 has original national characters without being translated
into unicode:

orzecznictwo do celów pozarentowych



I cannot compare these strings 'cos they are different.

What is the best advice? Please give some code portion with an advice.

Best Regards



Darek







[ Post a follow-up to this message ]



    Re: comparing strings  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-20-05 12:48 PM

Hi Dariusz,

that is more an html encoding question than a MCMS question.
You should better post this question to an IE/DOM/html related newsgroup.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"Dariusz Tomon" <d.tomon@mazars.pl> wrote in message
news:eicTpUWvFHA.2076@TK2MSFTNGP14.phx.gbl...
> Hello
>
> I'm trying to comparing to strings:
>
> 1. retrieved from custom xmlplaceholder:
> zrodlo = fact.Placeholders["kategoria2"] as XmlPlaceholder;
>
> esc_kat2 = Server.HtmlEncode(zrodlo.XmlAsString);
>
> esc_kat2 = esc_kat2.Replace("&lt;","");
>
> esc_kat2 = esc_kat2.Replace("&gt;","");
>
> esc_kat2 = esc_kat2.Replace("/Zones","");
>
> esc_kat2 = esc_kat2.Replace("/Zone","");
>
> esc_kat2 = esc_kat2.Replace("Zones","");
>
> kategoria2 = esc_kat2.Replace("Zone","");
>
> String kategoria2 has my nationals characters translated into unicode and
> looks like this:
>
> "orzecznictwo do celów pozarentowych"
>
> 2. The second one is retrieved from SQL database:
>
> selectCmd = "select * from urzond_main order by id";
>
> myCommand = new SqlCommand(selectCmd, myConnection);
>
> myConnection.Open();
>
> myReader = myCommand.ExecuteReader();
>
>
>
> while (myReader.Read())
>
> {
>
> kategoria1 = myReader.GetSqlString(1).ToString();
>
> }
>
>
>
> String kategoria1 has original national characters without being
> translated into unicode:
>
> orzecznictwo do celów pozarentowych
>
>
>
> I cannot compare these strings 'cos they are different.
>
> What is the best advice? Please give some code portion with an advice.
>
> Best Regards
>
>
>
> Darek
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:17 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register