Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Double definition of namespace when using VS2008 designer with dataset

namespace

  • Please log in to reply
1 reply to this topic

#1 Pignon

Pignon

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 01 June 2010 - 11:26 AM

Hello Everybody,

I'm preparing a WinForm application accessing SQL server tables with VS2008 standard edition.
I setted up a data set and then dragged and dropped a table to a form as a "detail view".
So I got all the usual objects (data set, BindingSource, TableAdapter, TableAdapterManager and BindingNavigator) on the form.
It works correctly as far as I make a correction in the code generated by the designer otherwise it doesn't compile ! This is due to a double definition of namespace.

Explanation:
In the designer generated file of the form (MyForm.Designer.cs) I have something like this:

namespace MySolution
partial class MyForm
{
...
private void InitializeComponent()
{
...

this.MyDataSet = new MySolution.MyDataSet();
this.tempProfile1BindingSource = new System.Windows.Forms.BindingSource(this.components);
this.MyTableAdapter = new MySolution.MyDataSetTableAdapters.MyTableAdapter();
this.tableAdapterManager = new MySolution.MyDataSetTableAdapters.TableAdapterManager();
...
}
...
}

With the 3 lines of code containing "new MySolution. ..." I get error message like:
The type name 'MyDataSet' does not exist in the type 'MySolution.MySolution' .

When removing the string "MySolution. " of the 3 lines I can then build. The problem is each time I just move a bit a component of the form the designer regenerates the code and I have to delete again to be able to build.
Any comment welcome... :-)
Many thanks for the attention.
Marc
  • 0

#2 BuckAMayzing

BuckAMayzing

    CC Regular

  • Just Joined
  • PipPipPip
  • 36 posts

Posted 01 June 2010 - 12:00 PM

Please, read this sticky.

I mean seriously, it'd be helpful.
  • 0





Also tagged with one or more of these keywords: namespace

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download