Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Error - Parent Columns and Child Columns don't have type-matching columns.

3 posts in OLEDB Last posting was on 2006-04-14 15:15:05.0Z
Michael Head Posted on 2006-04-06 16:25:01.0Z
Reply-To: "Michael Head" <Mike@GriffinHead.com>
From: "Michael Head" <mike@GriffinHead.com>
Newsgroups: advantage.oledb
Subject: Error - Parent Columns and Child Columns don't have type-matching columns.
Date: Thu, 6 Apr 2006 11:25:01 -0500
Lines: 35
Organization: GriffinHead Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 66.166.65.18
Message-ID: <44354013@solutions.advantagedatabase.com>
X-Trace: 6 Apr 2006 10:21:39 -0700, 66.166.65.18
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!66.166.65.18
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1151
Article PK: 1133672

I get this when I try to create a master-detail relationship with the
Autoinc field from one table to the int field on another.

If I change the AutoInc field to Integer, it works fine, but I need it to be
autoinc.

the sample code is below:
//Define a connection to the database
OleDbConnection connection = new OleDbConnection(CS);

//Create data adapters for retrieving data from the tables
OleDbDataAdapter AdapterCategories = new OleDbDataAdapter("SELECT SID,
FacilityID, ProviderID FROM Schedule", connection);
OleDbDataAdapter AdapterProducts = new OleDbDataAdapter("SELECT SchedID,
PatientID FROM SchedPat", connection);

DataSet dataSet11 = new DataSet();
//Create DataTable objects for representing database's tables
AdapterCategories.Fill(dataSet11, "Schedule");
AdapterProducts.Fill(dataSet11, "SchedPat");

//Set up a master-detail relationship between the DataTables
DataColumn keyColumn = dataSet11.Tables["Schedule"].Columns["SID"];
DataColumn foreignKeyColumn =
dataSet11.Tables["SchedPat"].Columns["SchedID"];
dataSet11.Relations.Add("ScheduleSchedPat", keyColumn, foreignKeyColumn);
//Right here is where I get the error on the line above

SID is autoinc and SchedID is just an Integer field.
I am using VS 2005 w/ ADS 7.1 OLEDB

Thanks for the help,
Michael Head


Mark Wilkins Posted on 2006-04-10 16:32:33.0Z
From: "Mark Wilkins" <tired@of.spam>
Newsgroups: advantage.oledb
References: <44354013@solutions.advantagedatabase.com>
Subject: Re: Error - Parent Columns and Child Columns don't have type-matching columns.
Date: Mon, 10 Apr 2006 10:32:33 -0600
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 198.102.102.12
Message-ID: <443a87d6@solutions.advantagedatabase.com>
X-Trace: 10 Apr 2006 10:29:10 -0700, 198.102.102.12
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.12
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1152
Article PK: 1133673

Hi Michael,

I think the SID (autoinc) field will be reported to the OleDb objects as an
unsigned integer. You might be able to explicitly cast the autoincrement
field to an integer in the SQL statement:
SELECT cast(SID as sql_integer) sid, FacilityID, ProviderID FROM Schedule

Mark Wilkins
Advantage R&D

"Michael Head" <mike@GriffinHead.com> wrote in message
news:44354013@solutions.advantagedatabase.com...
>I get this when I try to create a master-detail relationship with the
>Autoinc field from one table to the int field on another.
>
> OleDbDataAdapter AdapterCategories = new OleDbDataAdapter("SELECT SID,
> FacilityID, ProviderID FROM Schedule", connection);
> OleDbDataAdapter AdapterProducts = new OleDbDataAdapter("SELECT SchedID,
> PatientID FROM SchedPat", connection);
>


Mike Head Posted on 2006-04-14 15:15:05.0Z
Reply-To: "Mike Head" <mike@griffinhead.com>
From: "Mike Head" <mike@griffinhead.com>
Newsgroups: advantage.oledb
References: <44354013@solutions.advantagedatabase.com> <443a87d6@solutions.advantagedatabase.com>
Subject: Re: Error - Parent Columns and Child Columns don't have type-matching columns.
Date: Fri, 14 Apr 2006 10:15:05 -0500
Lines: 32
Organization: GriffinHead Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 66.166.65.18
Message-ID: <443fbb55@solutions.advantagedatabase.com>
X-Trace: 14 Apr 2006 09:10:13 -0700, 66.166.65.18
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!66.166.65.18
Xref: solutions.advantagedatabase.com Advantage.OLEDB:1153
Article PK: 1133674

Thanks Mark,
That worked like a champ!

Michael Head
GriffinHead Software

"Mark Wilkins" <tired@of.spam> wrote in message
news:443a87d6@solutions.advantagedatabase.com...
> Hi Michael,
>
> I think the SID (autoinc) field will be reported to the OleDb objects as
> an unsigned integer. You might be able to explicitly cast the
> autoincrement field to an integer in the SQL statement:
> SELECT cast(SID as sql_integer) sid, FacilityID, ProviderID FROM Schedule
>
> Mark Wilkins
> Advantage R&D
>
> "Michael Head" <mike@GriffinHead.com> wrote in message
> news:44354013@solutions.advantagedatabase.com...
>>I get this when I try to create a master-detail relationship with the
>>Autoinc field from one table to the int field on another.
>>
>> OleDbDataAdapter AdapterCategories = new OleDbDataAdapter("SELECT SID,
>> FacilityID, ProviderID FROM Schedule", connection);
>> OleDbDataAdapter AdapterProducts = new OleDbDataAdapter("SELECT SchedID,
>> PatientID FROM SchedPat", connection);
>>
>
>