473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

NVARCHAR and ODBC

Hello All,

I am using ODBC, connecting to an Oracle table that has a column of type
NVARCHAR.

When I try to retrieve data into a string, I don't see it. I imagine its
because the null padding in the data.

Here is some simplified code to show my issue.

// Oracle Table
// CREATE TABLE TableX
// ( EngColumn VARCHAR2(200),
// NLSColumn NVARCHAR2(400));

// EngColumn NLSColumn
// This is some text T h i s i s s o m e
t e x t
// Here is more text H e r e i s m o r e
t e x t

using System.Data;
using System.Data.Odbc;

private void InitializeData()
{
// MyConnection is an OdbcConnection control
OdbcConnection MyConnection = new OdbcConnection();
MyConnection.ConnectionString = = "DSN=" + HostName +
";UID=" + UserName + ";PWD=" + Password + ";";

string Query = "SELECT * FROM TableX";
MyConnection.Open();
OdbcDataAdapter daResults = new OdbcDataAdapter(Query, MyConnection);
MyConnection.Close();

DataTable dtResults = new DataTable();
daResults.Fill(dtResults);
DataGrid1.DataSource = dtResults;
}

private void DataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
{
MessageBox.Show(DataGrid1[DataGrid1.CurrentCell].ToString());
}

If I select a cell in the "EngColumn" I see the data. If I select a cell in
the NLSColumn, I get a blank string. I figure that it is something to do
with Unicode conversion, but I just can't seem to figure it out.

TIA,
pagates
Feb 9 '06 #1
0 1336

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Turloch O'Tierney | last post by:
Hi, I was wondering if the unicode datatypes can be retrieved through the jdbc-odbc bridge using a java client, I am currently getting question marks from NCHAR and NVARCHAR fields, and numbers...
5
by: Amit | last post by:
I am facing a problem while using SQL Server with VB application. Implicit conversion from datatype text to nvarchar is not allowed. Use the convert function to run this query. When i see the...
2
by: Vani Kancherlapalli | last post by:
Hi The maximum length of a nvarchar could be 4000 characters while that of varchar could be 8000. We are trying to use unicode which would require that the datatype for one our fields be...
7
by: Oleg Ogurok | last post by:
Hi all, I need to store data into about 104 columns. This is problematic with MS SQL, since it doesn't support rows over 8kb in total size. Most of the columns are of type NVARCHAR(255), which...
3
by: arijitchatterjee123 | last post by:
Hi Group, I am new with SQL Server..I am working with SQL Server 2000. I am storing the date in a nvarchar column of atable.... Now I want to show the data of Weekends..Everything is OK...But the...
1
by: iporter | last post by:
Hi - I am changing a field from type nvarchar to type text, given that I need to store strings longer than 255 characters. To do this I change the data type in SQL Server, then I change the...
4
by: D. | last post by:
Hi, I'm starting a new application in java using JTDS jdbc driver (http://jtds.sourceforge.net) and SQLServer 2005 Express. I have to design the database from scratch and my doubt is if I have to...
2
by: Marc Filthaut | last post by:
Hi, I have a problem, I have a table with a text type column and a nvarchar(2000) type column on my MS SQL 2000 Server. I know that the longest text in the text field is 1000 chars. I want to...
2
by: bharathreddy | last post by:
Here i will show the differences between nvarchar and varchar: The difference is that nvarchar is used to store unicode data, which is used to store multilingual data in the database tables....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.