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
Double definition of namespace when using VS2008 designer with dataset
Started by Pignon, Jun 01 2010 11:26 AM
1 reply to this topic


Sign In
Create Account

Back to top









