Click here to Skip to main content
15,927,744 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionhow to make new database through ado ? Pin
sumit2117-Apr-05 3:55
sumit2117-Apr-05 3:55 
AnswerRe: how to make new database through ado ? Pin
Colin Angus Mackay17-Apr-05 4:22
Colin Angus Mackay17-Apr-05 4:22 
GeneralRe: how to make new database through ado ? Pin
sumit2117-Apr-05 4:39
sumit2117-Apr-05 4:39 
GeneralRe: how to make new database through ado ? Pin
Colin Angus Mackay17-Apr-05 4:44
Colin Angus Mackay17-Apr-05 4:44 
Generaldatagrid with checkbox Pin
sumit2117-Apr-05 3:42
sumit2117-Apr-05 3:42 
GeneralRe: datagrid with checkbox Pin
Anonymous17-Apr-05 18:21
Anonymous17-Apr-05 18:21 
Generalretrieve primary key of table ????/ Pin
sumit2117-Apr-05 3:40
sumit2117-Apr-05 3:40 
GeneralRe: retrieve primary key of table ????/ Pin
Colin Angus Mackay17-Apr-05 4:14
Colin Angus Mackay17-Apr-05 4:14 
You can use the following SQL Statement to get the data out of the database that you want:
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS kcu 
	ON tc.CONSTRAINT_CATALOG = kcu.CONSTRAINT_CATALOG
	AND tc.CONSTRAINT_SCHEMA = kcu.CONSTRAINT_SCHEMA
	AND tc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME
WHERE tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND tc.TABLE_NAME = @TableName
If this SQL Statement returns rows then they each represent one of the columns of the primary key (maximum of 16). If it returns no rows then there is no primary key.

Does this help?


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralDialog box clicks effect underneath it Pin
mrCrisp17-Apr-05 3:33
mrCrisp17-Apr-05 3:33 
GeneralRe: Dialog box clicks effect underneath it Pin
Dave Kreskowiak17-Apr-05 15:19
mveDave Kreskowiak17-Apr-05 15:19 
GeneralBackup and restore Pin
Mr Dabbah16-Apr-05 20:34
Mr Dabbah16-Apr-05 20:34 
GeneralRe: Backup and restore Pin
Colin Angus Mackay17-Apr-05 1:43
Colin Angus Mackay17-Apr-05 1:43 
Generalbinding data in an array to a listbox Pin
Coreo16-Apr-05 13:04
Coreo16-Apr-05 13:04 
GeneralRe: binding data in an array to a listbox Pin
sumit2116-Apr-05 17:19
sumit2116-Apr-05 17:19 
GeneralRe: binding data in an array to a listbox Pin
Coreo17-Apr-05 4:17
Coreo17-Apr-05 4:17 
GeneralRe: binding data in an array to a listbox Pin
sumit2117-Apr-05 4:41
sumit2117-Apr-05 4:41 
Questionadding images is menubar ?? Pin
sumit2116-Apr-05 3:52
sumit2116-Apr-05 3:52 
AnswerRe: adding images is menubar ?? Pin
skrtbh16-Apr-05 6:03
skrtbh16-Apr-05 6:03 
GeneralError in refer DLL Pin
nitin_ion15-Apr-05 21:30
nitin_ion15-Apr-05 21:30 
GeneralShowing different forms depending on a treeview in vb.NET Pin
ScruffyDuck15-Apr-05 20:04
ScruffyDuck15-Apr-05 20:04 
GeneralRe: Showing different forms depending on a treeview in vb.NET Pin
Nicholas Cardi16-Apr-05 2:23
Nicholas Cardi16-Apr-05 2:23 
GeneralRe: Showing different forms depending on a treeview in vb.NET Pin
ScruffyDuck16-Apr-05 2:54
ScruffyDuck16-Apr-05 2:54 
GeneralManaged in Unmanaged Pin
nitin_ion15-Apr-05 19:50
nitin_ion15-Apr-05 19:50 
GeneralRe: Managed in Unmanaged Pin
nitin_ion15-Apr-05 21:32
nitin_ion15-Apr-05 21:32 
GeneralRe: Managed in Unmanaged Pin
Nicholas Cardi16-Apr-05 2:19
Nicholas Cardi16-Apr-05 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.