PC Review


Reply
Thread Tools Rate Thread

DataRelation on Byte[] columns

 
 
=?Utf-8?B?Sm9lIFNjaG1pdHQ=?=
Guest
Posts: n/a
 
      18th Jan 2005
I am accessing a Oracle Db and both my primary and foreign keys are defined
as RAW(16) when I try to add the relationship I get a exception stating
"These columns don't currently have unique values.". I know the columns are
unique, do DataRelation's support Byte[] columns? If I change my select to to
call RAWTOHEX on the PK and FK column it works.

OracleConnection cConn = new OracleConnection( ... );
OracleDataAdapter cDA = new OracleDataAdapter( "select COUNTRY_PK,
COUNTRY_NAME from country", cConn );
OracleDataAdapter rDA = new OracleDataAdapter( "select COUNYTRY_FK,
REGION_NAME from region", cConn );

// the following changes will make this work
//OracleDataAdapter cDA = new OracleDataAdapter( "select
RAWTOHEX(COUNTRY_PK), COUNTRY_NAME from country", cConn );
//OracleDataAdapter rDA = new OracleDataAdapter( "select
RAWTOHEX(COUNYTRY_FK), REGION_NAME from region", cConn );

cConn.Open();

DataSet cDS = new DataSet();

cDA.Fill( cDS, "COUNTRY");
rDA.Fill( cDS, "REGION" );

cConn.Close();

// throws exception here - COUNTRY_PK and COUNTRY_FK are defined as RAW(16)
DataRelation countryRel = cDS.Relations.Add("CountryRegions",
cDS.Tables["COUNTRY"].Columns["COUNTRY_PK"],
cDS.Tables["REGION"].Columns["COUNTRY_FK"] );
countryRel.Nested = true;

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Can you improve this code : Search Byte[] backwards for byte Pattern Family Tree Mike Microsoft C# .NET 0 26th Sep 2008 12:34 AM
View all columns from a DataRelation Muffin Microsoft C# .NET 0 31st Jan 2008 10:49 PM
Best Performance File Compare: MD5/SHA1 or Byte-by-Byte Checking? Mahmoud Al-Qudsi Microsoft C# .NET 6 4th Apr 2007 04:48 PM
Dataset, Datarelation between varchar columns Bob Microsoft C# .NET 0 10th Sep 2006 09:10 PM
formatting individual columns for different languages, including double-byte characters Sandra Microsoft Excel Misc 5 20th Jun 2004 01:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:52 AM.