Retrieve List of DataSets in Project

  • Thread starter Thread starter Mark Olbert
  • Start date Start date
M

Mark Olbert

Is there an example of how to retrieve a list of DataSet classes that are defined in a project? The
Create DataSet context menu command on the SqlDataAdapter component does this. I'd like to be able
to provide similar functionality in a component I'm writing.

Thanx in advance!

- Mark
 
Assembly a = typeof(SomeClassInTheAssembly).Module.Assembly;
foreach(Type t in a.GetTypes())
{
if(t.IsSubclassOf(typeof(DataSet)))
{
 
Thanx, I thought of that but am having a hard time discovering a type in the assembly from inside
the component. What I end up with is the assembly that the component is in, which isn't where the
datasets would be.

Thoughts?

- Mark
 
Hi,

How about the method AppDomain.GetAssemblies?
I think it will give you the current loaded assembly list, of course you
may need filter those assemblies like "microsoft.visualstudio.dll",
"system.dll" etc, since they are not user-defined assemblies.

Does it resolve your problem?

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Ying-Shen,

That might work. For now, I came up with a different approach which creates the DataSet I need from
within the component I use it in. Not sure if that'll get me across the goal line, but we'll see...

- Mark
 
Back
Top