Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OpenSchema in VB .NET

Posted on 2006-11-21
5
Medium Priority
?
738 Views
Last Modified: 2008-03-03
Does anyone have some sample VB .NET code that shows how to use OpenSchema?


My intent is to ask a database what tables are inside of it.

Then to take that list of tables and ask each table what the column names are that it has.
0
Comment
Question by:Tom Knowlton
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17990848
Hi knowlton,

Are you using this for an Analysis Services cube?  If not I'm not sure if OpenSchema is what you want.

If you just want a list of all tables in the (assuming SQL Server 2000) database, use:

select name, id from sysobjects where xtype = 'U'  

then to get all of the column names, use:

select name from syscolumns where id = <id from previous query>


Cheers,
Hillwaaa
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 17990857
What about if it is an MS Acess MDB file?
0
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 2000 total points
ID: 17990906
knowlton,

Then I'd suggest looking at the code here: http://www.freevbcode.com/ShowCode.asp?ID=3884

It's VB6 but should be fairly easy to translate to VB .NET, and contains an example on using OpenSchema :)
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 17992109
Thank you.
0
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17992113
No worries!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question