Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sqldmo
Message
From
08/08/2003 14:15:10
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Sqldmo
Miscellaneous
Thread ID:
00818353
Message ID:
00818353
Views:
75
All,

Does anyone know how to add a primary key to a table using SQLDMO? When I try it with the code below the oTable.primarykey object = nothing. Any ideas would be great.

Here's the code,
Dim oKey As New SQLDMO.Key()
....
oKey.KeyColumns.Add(listFields.Items(I).Text)
oTable.PrimaryKey.Type = SQLDMO.SQLDMO_KEY_TYPE.SQLDMOKey_Primary
oTable.PrimaryKey.Clustered = False
oTable.PrimaryKey.KeyColumns.Add(oKey.KeyColumns.Item(0))
Thanks

Jim
Reply
Map
View

Click here to load this message in the networking platform