Hello NG,

I've a dataset which gets it's data from a
sql= "select usr,grop from tab1 where ..."
where usr is primary key field in this ORA-Table.
But creating the primary-Key-Constraint will cause an
error because "values are not unique" (correct
translation?? in german "nicht eindeutig")

With cmd
.CommandText = SQL
.Connection = cnORA
End With
da.SelectCommand = cmd
da.Fill(ds, "PRF_tab1")

With ds.Tables("PRF_tab1")
ERROR-> .Constraints.Add("USR_KEY", .Columns("USR"), True)
End With

I've tried the select in ORA-Worksheet, I cannot find any
double values.

Where is the problem??
thanks!
Peter

Re: Constraint-Problem by Miha

Miha
Thu Dec 18 09:00:11 CST 2003

Hi Dr.,

You might bind your table to a datagrid (without adding constraint) and
check the data.
Are you invoking Fill more than once perhaps?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Dr. P. Dietz" <anonymous@discussions.microsoft.com> wrote in message
news:07fd01c3c576$ed886e60$a401280a@phx.gbl...
> Hello NG,
>
> I've a dataset which gets it's data from a
> sql= "select usr,grop from tab1 where ..."
> where usr is primary key field in this ORA-Table.
> But creating the primary-Key-Constraint will cause an
> error because "values are not unique" (correct
> translation?? in german "nicht eindeutig")
>
> With cmd
> .CommandText = SQL
> .Connection = cnORA
> End With
> da.SelectCommand = cmd
> da.Fill(ds, "PRF_tab1")
>
> With ds.Tables("PRF_tab1")
> ERROR-> .Constraints.Add("USR_KEY", .Columns("USR"), True)
> End With
>
> I've tried the select in ORA-Worksheet, I cannot find any
> double values.
>
> Where is the problem??
> thanks!
> Peter