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();