Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2004, 06:14 AM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataColumn .Unique property not being set

I am creating a dataset from a SQL Server database. The underlying table has a unique constraint on one of the columns, but this is not being reflected in the .Unique property of the appropriate DataColumn. Is there any way I can get this property to update automatically.

For example, the Field Length and Allow Nulls properties do net get written to the dataset unless you set da.MissingSchemaAction = MissingSchemaAction.AddWithKey

Is there something else I can set to add the .Unique property? I know this can be set manually but I need a generic solution as I will not always know which database fields have unique constraints.

Thanks for your help

 
Old November 4th, 2004, 02:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

why dont u set it to DataSet in Design time?! or u genrate ur DataSet at run time?

Keep in touch.

Always:),
Hovik Melkomian.
 
Old November 4th, 2004, 06:48 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try generating Typed Dataset probably you will get it there.


It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old November 4th, 2004, 06:50 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this link
http://www.dotnetextreme.com/code/getdbschema.asp


It is not how much we do,
but how much love we put in the doing.

-Mother Theresa





Similar Threads
Thread Thread Starter Forum Replies Last Post
Condition to set a unique ID between 2 btns onClic ismailc XSLT 0 August 18th, 2008 09:04 AM
Get Set Property value being lost asn187 ASP.NET 2.0 Professional 1 April 19th, 2007 03:09 PM
Selecting unique set of elements Chamkaur XSLT 1 March 15th, 2007 05:43 AM
Set accountExpires property r_ganesh76 C# 0 August 9th, 2006 01:16 AM
DataGrid DataColumn Property Set at Run-time karhodes ADO.NET 0 April 14th, 2004 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.