Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 902833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:46:51+00:00 2026-05-15T15:46:51+00:00

In VS 2005 C#, While inserting Euro (€) Symbol into Db2 table, It is

  • 0

In VS 2005 C#, While inserting Euro (€) Symbol into Db2 table, It is storing values correctectly. DISABLEUNICODE=1 parameter helped to store this correctly.

But when we try to read from the table, it is giving junk char as below.

“Spec GS 1”

Same code is working in VB 6.0 ADO

Could you please help me.


Code:

OdbcConnection con = new OdbcConnection();
OdbcDataAdapter dataAdapter = new OdbcDataAdapter("SELECT * FROM XXXX.XXXX" , con);
OdbcCommand odbcCommand =
    new OdbcCommand(
        "INSERT INTO   XXXX.XXXX( BREACH_TYPE,JURISDICTION,ACTIVE ,VERIFIED , UPDATED_TS , UPDATED_BY ,VERIFIED_TS ,VERIFIED_BY)VALUES ('Spec GS € 1','IRE','Y','Y',CURRENT TIMESTAMP,'XECCRT3',CURRENT TIMESTAMP,'XECCRT8')");

con.ConnectionString = "DSN=DSNT;UID=xxxxxx;PWD=xxxxxx;MODE=SHARE;DBALIAS=DSNT;DISABLEUNICODE=1;PATCH1=1024;LONGDATACOMPAT=1;LOBMAXCOLUMNSIZE=1048575;PATCH2=6;";
con.Open();

odbcCommand.Connection = con; 
odbcCommand.ExecuteNonQuery();

dataAdapter.SelectCommand.CommandTimeout = 0;

DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
DataTable result = dataSet.Tables[0];

string Text = result.Rows[0][0].ToString();

MessageBox.Show(Text = result.Rows[0][0].ToString());

con.Close(); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:46:52+00:00Added an answer on May 15, 2026 at 3:46 pm

    After reading the text from DataSet, used the following encoding function to display correct data.

     private static string ConvertToAsciiString(string str)
    {            
        Encoding source = Encoding.Default ;
        Encoding dest = Encoding.Unicode ;
    
        // Convert the string into a byte[].
        byte[] sourceBytes = dest.GetBytes(str);
    
        // Perform the conversion from one encoding to the other.
        byte[] destBytes = Encoding.Convert(source, dest, sourceBytes);
    
        string asciiString = dest.GetString(destBytes);
        asciiString = asciiString.Replace("\0", string.Empty);
    
    
        return asciiString; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to easily sort in SQL Server 2005 while ignoring hyphens
While porting an application from SQL 2005 to SQL Server Compact Edition, I found
While in the final throws of upgrading MS-SQL Server 2005 Express Edition to MS-SQL
I use VS2008 at home and love it, while approaching work about upgrading 2005
Starting with 2005, VS started this behavior of when starting debugging session it spawns
With the Visual Studio 2005 C++ compiler , I get the following warning when
In Visual Studio 2005, whenever I would view a file in the main editor,
Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the
I installed Visual Studio 2005 ( with SP1 ) and made the default settings
In SQL Server 2000/2005, Is it possible to force the default value to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.