PC Review


Reply
Thread Tools Rate Thread

Problems with binding to binding source on base form in VS 2005

 
 
=?Utf-8?B?SmltIFRpbHNvbg==?=
Guest
Posts: n/a
 
      10th Oct 2006
I have a base form for performing searches. The base form has a protected
BindingSource object called searchResultsBindingSource.

On my derived forms (for example, CompanySearch), I instantiate a dataset
and set the base form's binding source to the dataset with no problem.

On one particular form, however, I have child tables; when I set the child
BindingSource object's DataSource to searchResultsBindingSource, then set the
child BindingSource object's DataMember property to the name of the
relationship to use, the designer gives me an error about "DataMember
property 'xxx' cannot be found on DataSource."

The form works perfectly fine when I run the application; the problem is
that, once I wire up the BindingSources, I lose the ability to edit the
derived form in the designer. Am I doing anything wrong, or is this a
limitation of the designer?

Thanks,
--
Jim Tilson
MCP
 
Reply With Quote
 
 
 
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      11th Oct 2006
Hi Jim,

I performed a test based on your description and did produce the problem.

I have looked up in our inner data base and found that this is a known
issue. The reason this is not working is that the Serialization groups
statements of a particular object together when deserializing. Because of
this, the follow code that works at run time:

searchResultsBindingSource.BeginInit();
bindingSource1.BeginInit();

searchResultsBindingSource.DataSource = dataSet;
bindingSource1.DataSource = searchResultsBindingSource;
bindingSoruce1.DataMember = "Table1";

searchResultsBindingSource.EndInit();
bindingSource1.EndInit();

Is executed by the deserialization engine in the following manner:

bindingSource1.BeginInit();
bindingSource1.DataSource = searchResultsBindingSource;
bindingSource1.DataMember = "Table1";
bindingSource1.EndInit(); // Exception thrown here because column1 could
not be found

searchResultsBindingSource.BeginInit();
searchResultsBindingSource.DataSource = dataSet;
searchResultsBindingSource.EndInit();

This would work correctly if the orders of searchResultsBindingSource and
bindingSource1 were reversed. The inheritance of the form is causing
bindingSource1 to come first because the derived class uses bindingSource1
before searchResultsBindingSource.

Unfortunately, there's no good way to fix this. Our evaluation dertermined
that it doesn't meet the criteria to be addressed in this release of Visual
Studio. Additionally, as part of planning and analysis of future version
this bug will be considered again for possible inclusion.

If you submitted this bug because of a blocking problem you're experiencing
and continue to experience, you may open a support call with Microsoft
Professional Services
(http://support.microsoft.com/?LN=en-...rprophone&x=8&
y=14), which is a better support option when you're experiencing business
impact for your problem and are unable to resolve it in a timely manner on
forums or other support channels.

At last, I think a simple workaround would be to set the DataMember
property of bindingSource1 in the inherited form at run-time, which avoids
the problem.

Thank you for your bug report.

If you have anything unclear, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRpbHNvbg==?=
Guest
Posts: n/a
 
      16th Oct 2006
Linda,

Thank you for your answer! I had a hunch that it was a serialization
problem; when I deleted the call to EndInit() on the child binding source,
the designer started working again until the designer code was regenerated
and then EndInit() call re-inserted.

It's not a show-stopper--just annoying, since I was setting up the binding
at design-time so I could set up datagrid columns in the designer. We're able
to work around it.

--
Jim Tilson
MCP


"Linda Liu [MSFT]" wrote:

> Hi Jim,
>
> I performed a test based on your description and did produce the problem.
>
> I have looked up in our inner data base and found that this is a known
> issue. The reason this is not working is that the Serialization groups
> statements of a particular object together when deserializing. Because of
> this, the follow code that works at run time:
>
> searchResultsBindingSource.BeginInit();
> bindingSource1.BeginInit();
>
> searchResultsBindingSource.DataSource = dataSet;
> bindingSource1.DataSource = searchResultsBindingSource;
> bindingSoruce1.DataMember = "Table1";
>
> searchResultsBindingSource.EndInit();
> bindingSource1.EndInit();
>
> Is executed by the deserialization engine in the following manner:
>
> bindingSource1.BeginInit();
> bindingSource1.DataSource = searchResultsBindingSource;
> bindingSource1.DataMember = "Table1";
> bindingSource1.EndInit(); // Exception thrown here because column1 could
> not be found
>
> searchResultsBindingSource.BeginInit();
> searchResultsBindingSource.DataSource = dataSet;
> searchResultsBindingSource.EndInit();
>
> This would work correctly if the orders of searchResultsBindingSource and
> bindingSource1 were reversed. The inheritance of the form is causing
> bindingSource1 to come first because the derived class uses bindingSource1
> before searchResultsBindingSource.
>
> Unfortunately, there's no good way to fix this. Our evaluation dertermined
> that it doesn't meet the criteria to be addressed in this release of Visual
> Studio. Additionally, as part of planning and analysis of future version
> this bug will be considered again for possible inclusion.
>
> If you submitted this bug because of a blocking problem you're experiencing
> and continue to experience, you may open a support call with Microsoft
> Professional Services
> (http://support.microsoft.com/?LN=en-...rprophone&x=8&
> y=14), which is a better support option when you're experiencing business
> impact for your problem and are unable to resolve it in a timely manner on
> forums or other support channels.
>
> At last, I think a simple workaround would be to set the DataMember
> property of bindingSource1 in the inherited form at run-time, which avoids
> the problem.
>
> Thank you for your bug report.
>
> If you have anything unclear, please feel free to let me know.
>
>
> Sincerely,
> Linda Liu
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      17th Oct 2006
Hi Jim,

Thanks for your update.

Since there's no good workaround for this particular issue now, your
workaround is an alternative, which at least enables the derived forms to
be opened in the designer.

Thank you for your workaround. I think it will benefit all the readers in
the community.

If you have any questions in the future, please don't hesitate to contact
us. It's always our pleasure to be of assistance.


Sincerely,
Linda Liu
Microsoft Online Community Support

 
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
Trouble with binding navigator and/or associated binding source Mike Microsoft ADO .NET 0 29th Jul 2006 04:17 PM
any know issues in installing VB.NET 2005 Express, VS.NET 2005 Standard, SQL Server 2005 Express and SQL Server 2005 LeAnne Microsoft VB .NET 2 30th Dec 2005 12:27 PM
Security programs 2005 - , Firewall programs 2005 -, Antivirus programs 2005 -, APPDEV DOT NET SECURITY, Linux Security and Firewall programs 2005 -, CiscoWorks ( CW ) Security programs 2005 - , futa Microsoft Access Security 3 2nd Mar 2005 05:04 AM
Security programs 2005 - , Firewall programs 2005 -, Antivirus programs 2005 -, APPDEV DOT NET SECURITY, Linux Security and Firewall programs 2005 -, CiscoWorks ( CW ) Security programs 2005 - , futa Anti-Virus 0 25th Feb 2005 02:30 PM
McAfee 2005 All In One, McAfee AntiSpyware V1.0 2005, McAfee Personal Firewall Plus V6.0 2005, McAfee QuickClean V5.0 2005, McAfee SpamKiller V6.0 2005, McAfee VirusScan V9.0 2005, new !, other code_fu Anti-Virus 0 1st Oct 2004 11:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:18 AM.