I think Dataset designer attribute has private accessor. I use Binding source designer attribute below
[Designer(
"System.Windows.Forms.Design.BindingSourceDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public partial class myDataSet : System.Data.DataSet {.................
This is usefull. Add this attribute befor class definition. This class (derived dataset) now can be added any form or control at design time...
Note: I create this myDataSet C# code using XSD.exe tool. For Example I create a untyped dataset with SQL clause(at runtime). I fill it and then save its Schema. then at runtime, use XSD.exe tool and create this yourPrivateTypedDataSet's C# Code. and now again build it and use new typed dataset...
(For building at runtime you can write code same below
CSharpCodeProvider
csCompiler = new CSharpCodeProvider();
ICodeCompiler iCodeCompiler = csCompiler.CreateCompiler();
....... //out location
.......// Add assemblies etc...
CompilerResults cResult = iCodeCompiler.CompileAssemblyFromSource(compilerParams, source);
)
If you have any questions write me please... tugrul.karakaya@gmail.com