HighTechTalks DotNet Forums  

ODBC "Umlaut" problem

Dotnet Framework (ODBC.net) microsoft.public.dotnet.framework.odbcnet


Discuss ODBC "Umlaut" problem in the Dotnet Framework (ODBC.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default ODBC "Umlaut" problem - 09-04-2004 , 03:53 PM






My problem is that I want to fill a dataset from a mysql database, but
instead of the german special characters (Umlaut) I get some garbage.
I'm using C# and my code is

strSelectKommando = "SELECT * FROM Empfaenger WHERE
id=" + id;
// id is the primary key, so there will be only 1
element in the dataset

strConnection = "STMT=;OPTION=3;DSN=xxx;UID=xxx;PASSWORD=xxx;DESC= MySQL
ODBC 3.51 Driver DSN;DATABASE=xxx;SERVER=localhost;PORT=3306";

odBcVerbindung = new OdbcConnection(strConnection);
odBcKommando = new OdbcCommand(strSelectKommando, odBcVerbindung);
daAdapter = new OdbcDataAdapter(odBcKommando);
dsNamenSatz = new DataSet();
try
{
odBcVerbindung.Open();
daAdapter.Fill(dsNamenSatz, "Empf");
}
catch (OdbcException ex)
{ ... }

odBcVerbindung.Close();

foreach (DataRow datReihe in dsNamenSatz.Tables["Empf"].Rows)
{
try
{
someStringVariable = datReihe["Name"].ToString();
}
catch
{
someStringVariable = "";
}
}

If the entry for Name contains an Umlaut, the variable
someStringVariable will contain some garbage characters instead where
the Umlaut should appear.

Any help is appreciated! Thanks a lot!

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.