Quantcast
Channel: DataSource Controls - SqlDataSource, ObjectDataSource, etc.
Viewing all articles
Browse latest Browse all 956

How can i best resolve the error "These columns don't currently have unique values."

$
0
0

Hi ,

I currently have a select that resturns the following 

select distinct  A_CODE, S_CODE, T_ID

the result is as follows

81001 , Sup1, T1

81001,  Sup1, T2

the issue is that in my c# code i have a rule that sets the primary key  as 

InternalSetPrimaryKey(MyTable, new string[3] { "A_CODE", "S_CODE"});

The issue is that there are two rows retrieved becuase of the last column and the distinct,. 

Is it best to just add the last column , T_ID to the primary key constraint , since it is a one to may relationship ?

thanks


Viewing all articles
Browse latest Browse all 956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>