SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Problem adding DataSet in Design-Mode

Last post 08-13-2007 3:44 PM by tugrulkarakaya. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-01-2005 10:00 PM

    Problem adding DataSet in Design-Mode

    There's a problem adding the DataSet-Component in Design-Mode with #D up to Build 531. The following error occurs if you try to add it to the form:

    .NET Version         : 2.0.50215.44
    OS Version           : Microsoft Windows NT 5.1.2600 Service Pack 2
    Boot Mode            : Normal
    Working Set Memory   : 91532kb
    SharpDevelop Version : 2.0.0.531

    Failed to create component 'DataSet'.  The error message follows:
     'System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.VSDesigner.Data.VS.DataSetDesigner.Initialize(IComponent component)
       at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
       at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType)
       at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
       at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
       at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
       at System.Windows.Forms.Design.OleDragDropHandler.Creat...'
    Exception thrown:
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.VSDesigner.Data.VS.DataSetDesigner.Initialize(IComponent component)
       at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
       at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
       at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType)
       at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
       at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
       at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
       at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgs e)


  • 08-13-2007 3:44 PM In reply to

    Re: Problem adding DataSet in Design-Mode

    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

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.