João,
| when i´m filling my datatable using my dataadapter, the datatable only
have
| one ???
Which unique constraints does it have?
PK_xTable
IX_xTable
IX_xTable_1
I suspect it only has PK_xTable.
| is there any workarround for it, besides do it by code ???
Did you let the DataAdapter define your DataTable or did you use an XSD or
code?
I suspect you let the DataAdapter
In your XSD or Code are you certain that you defined all constraints
correctly?
My understanding is: Seeing as you have a PrimaryKey, the DataAdapter will
only add the Primary Key constraint & leave the other two unique constraints
off. Based on the three rules at:
http://msdn.microsoft.com/library/de...chematopic.asp
I normally define my datatable schemas in an XSD file & either load that
directly first or have a typed DataSet.
For a complete explanation of Datasets, DataTables, & DataAdapters along
with how to use them. I would strongly recommend you read David Sceppa's
book "Microsoft ADO.NET - Core Reference" from MS Press. As it is both a
good tutorial on ADO.NET as well as a good desk reference once you know
ADO.NET.
Hope this helps
Jay
"João Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
| Hi all
|
| i have a problem with my sql dataadapter, i think.
| i have this table below ( Script ) and this table has one particularity,
it
| has 2 unique constraints.
|
| when i´m filling my datatable using my dataadapter, the datatable only
have
| one ???
|
| is there any workarround for it, besides do it by code ???
|
| thsk
| JSB
|
|
|
|
| CREATE TABLE [dbo].[xTable] (
| [Test0] [char] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
| [Test1] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
| [Test2] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
| [Test3] [char] (10) COLLATE Latin1_General_CI_AS NULL ,
| [Test4] [char] (10) COLLATE Latin1_General_CI_AS NULL
| ) ON [PRIMARY]
| GO
|
| ALTER TABLE [dbo].[xTable] ADD
| CONSTRAINT [PK_xTable] PRIMARY KEY CLUSTERED
| (
| [Test0]
| ) ON [PRIMARY] ,
| CONSTRAINT [IX_xTable] UNIQUE NONCLUSTERED
| (
| [Test0],
| [Test1]
| ) ON [PRIMARY] ,
| CONSTRAINT [IX_xTable_1] UNIQUE NONCLUSTERED
| (
| [Test2],
| [Test3],
| [Test4]
| ) ON [PRIMARY]
| GO
|
|
|