Thanks Greg for your reponse.
Mauricio, You can add a Constraint into the DataTable using
dataSet.Tables["TableName"].Constraints.Add() method. You can refer to the
following link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataDataTableClassConstraintsTopic.asp
For how to create a constraint in ADO .net, please check the following link
for reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdataconstraintclasstopic.asp
If anything is unclear, please feel free to reply to the post.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
--------------------
| From: "Greg" <
[email protected]>
| References: <
[email protected]>
| Subject: Re: Unique Constraint with DataSet.
| Date: Thu, 6 Nov 2003 08:20:21 -0500
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: uslec-66-255-38-123.cust.uslec.net 66.255.38.123
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:65627
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Yes, you can create constraints on DataTable. Take a look at PrimaryKey,
| Unique Key and Foreign key
| | > Is it possible to create a unique constraint with DataSet?
| > I have a field in a table where it can't be duplicated.
| > Is there a way to create a unique constraint like made in
| > SQL databases?
| > Thanks.
| > Mauricio (Brazil)
| >
| >
|
|
|