PC Review


Reply
Thread Tools Rate Thread

Designer generated code fails to compile

 
 
Pat Moran
Guest
Posts: n/a
 
      11th Apr 2008
I have a project whose default name space is Wearther and form in the project
which is in this default namespace. I have also generated a dataset and
adapters to access a table in a database. I am using as a datasource this
dataset via the generated DatasetBindingSource.

The problem is that the code the designed generates includes the lines

this.wEATHERDETAILSTableAdapter = new
Weather._WeatherDetailsDataSetTableAdapters.WEATHERDETAILSTableAdapter();
this._WeatherDetailsDataSet = new Weather._WeatherDetailsDataSet();

which explicitly specify the Weather namespace although the class is
actually in this namespace and so the compilation fails unless I remove the
namespace qualification by hand.

How do I stop the designer from setting the namespace explicitly.

Thanks

Pat

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      11th Apr 2008
I am not sure what is going on here, from your explanation.

I can tell you that you cannot get the tool to change it spots. It will
always use explicit naming. You can, if you know the correct information, go
through and whack it with Replace, however.

I have read your post a few times and I am not sure how you ended up with
this clash in the first place. If you can figure that out, the fact the tool
is explicit should not matter.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Pat Moran" <(E-Mail Removed)> wrote in message
news:9C22FD17-351E-46B2-9C23-(E-Mail Removed)...
>I have a project whose default name space is Wearther and form in the
>project
> which is in this default namespace. I have also generated a dataset and
> adapters to access a table in a database. I am using as a datasource this
> dataset via the generated DatasetBindingSource.
>
> The problem is that the code the designed generates includes the lines
>
> this.wEATHERDETAILSTableAdapter = new
> Weather._WeatherDetailsDataSetTableAdapters.WEATHERDETAILSTableAdapter();
> this._WeatherDetailsDataSet = new Weather._WeatherDetailsDataSet();
>
> which explicitly specify the Weather namespace although the class is
> actually in this namespace and so the compilation fails unless I remove
> the
> namespace qualification by hand.
>
> How do I stop the designer from setting the namespace explicitly.
>
> Thanks
>
> Pat
>



 
Reply With Quote
 
 
 
 
Pat Moran
Guest
Posts: n/a
 
      11th Apr 2008
I don't know how it ends up like this but it is the case for a few but not
all geenrated datasets. I know I can simply edit the geenrated code to remove
the namespace and it wil compile. It is however very tedious to have to do
this several times a day.

The generated code uses the explicit naming only for these two statements.

"Cowboy (Gregory A. Beamer)" wrote:

> I am not sure what is going on here, from your explanation.
>
> I can tell you that you cannot get the tool to change it spots. It will
> always use explicit naming. You can, if you know the correct information, go
> through and whack it with Replace, however.
>
> I have read your post a few times and I am not sure how you ended up with
> this clash in the first place. If you can figure that out, the fact the tool
> is explicit should not matter.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
> http://gregorybeamer.spaces.live.com/lists/feed.rss
>
> or just read it:
> http://gregorybeamer.spaces.live.com/
>
> *************************************************
> | Think outside the box!
> |
> *************************************************
> "Pat Moran" <(E-Mail Removed)> wrote in message
> news:9C22FD17-351E-46B2-9C23-(E-Mail Removed)...
> >I have a project whose default name space is Wearther and form in the
> >project
> > which is in this default namespace. I have also generated a dataset and
> > adapters to access a table in a database. I am using as a datasource this
> > dataset via the generated DatasetBindingSource.
> >
> > The problem is that the code the designed generates includes the lines
> >
> > this.wEATHERDETAILSTableAdapter = new
> > Weather._WeatherDetailsDataSetTableAdapters.WEATHERDETAILSTableAdapter();
> > this._WeatherDetailsDataSet = new Weather._WeatherDetailsDataSet();
> >
> > which explicitly specify the Weather namespace although the class is
> > actually in this namespace and so the compilation fails unless I remove
> > the
> > namespace qualification by hand.
> >
> > How do I stop the designer from setting the namespace explicitly.
> >
> > Thanks
> >
> > Pat
> >

>
>
>

 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      14th Apr 2008
One option you might try is setting up an application that can clean out the
namespace from the file(s). It will take an hour or so, but can save you a
lot of time in the long run.

I would also find out why the namespace is not working and see if you can
get the tool to create the file with explicit naming where it is correct.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Pat Moran" <(E-Mail Removed)> wrote in message
news:9253756B-1E7B-4C28-ADDD-(E-Mail Removed)...
>I don't know how it ends up like this but it is the case for a few but not
> all geenrated datasets. I know I can simply edit the geenrated code to
> remove
> the namespace and it wil compile. It is however very tedious to have to do
> this several times a day.
>
> The generated code uses the explicit naming only for these two statements.
>
> "Cowboy (Gregory A. Beamer)" wrote:
>
>> I am not sure what is going on here, from your explanation.
>>
>> I can tell you that you cannot get the tool to change it spots. It will
>> always use explicit naming. You can, if you know the correct information,
>> go
>> through and whack it with Replace, however.
>>
>> I have read your post a few times and I am not sure how you ended up with
>> this clash in the first place. If you can figure that out, the fact the
>> tool
>> is explicit should not matter.
>>
>> --
>> Gregory A. Beamer
>> MVP, MCP: +I, SE, SD, DBA
>>
>> Subscribe to my blog
>> http://gregorybeamer.spaces.live.com/lists/feed.rss
>>
>> or just read it:
>> http://gregorybeamer.spaces.live.com/
>>
>> *************************************************
>> | Think outside the box!
>> |
>> *************************************************
>> "Pat Moran" <(E-Mail Removed)> wrote in message
>> news:9C22FD17-351E-46B2-9C23-(E-Mail Removed)...
>> >I have a project whose default name space is Wearther and form in the
>> >project
>> > which is in this default namespace. I have also generated a dataset
>> > and
>> > adapters to access a table in a database. I am using as a datasource
>> > this
>> > dataset via the generated DatasetBindingSource.
>> >
>> > The problem is that the code the designed generates includes the lines
>> >
>> > this.wEATHERDETAILSTableAdapter = new
>> > Weather._WeatherDetailsDataSetTableAdapters.WEATHERDETAILSTableAdapter();
>> > this._WeatherDetailsDataSet = new Weather._WeatherDetailsDataSet();
>> >
>> > which explicitly specify the Weather namespace although the class is
>> > actually in this namespace and so the compilation fails unless I remove
>> > the
>> > namespace qualification by hand.
>> >
>> > How do I stop the designer from setting the namespace explicitly.
>> >
>> > Thanks
>> >
>> > Pat
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio Designer deleting necessary designer code Jason Microsoft C# .NET 4 24th Apr 2009 01:09 AM
Visual Studio DataSet designer doesn't regenerate designer.cs code Barney Microsoft C# .NET 3 15th Oct 2007 04:15 PM
"Windows Form Designer generated code" section is hidden when viewing code QLD_AU Microsoft Dot NET 1 19th Dec 2005 04:44 PM
CSharpCodeProvider generated EXE embedded with ResourceWriter generated .resources fails... Jon Rista Microsoft C# .NET 4 1st Oct 2005 07:49 PM
How to generate custom code in the "Windows Form Designer generated code" section =?Utf-8?B?Lk5ldCBEZXZlbG9wZXI=?= Microsoft Dot NET Framework Forms 3 3rd May 2004 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:21 AM.