Datasources and Display

W

Wingot

Hey,



I have an application codenamed WingFlex. It has a number of aspects to
it, but the prudent parts for this problem are all within the "Client"
Schema. The Client schema has three tables in it, on named Country, one
named MedicalCondition, and one named Customer. The Customer database
has five foreign keys in it, one to Country, one to MedicalCondition,
and three as self referential keys to Customer (BillTo, for where the
bill goes, EmergencyContact1, and EmergencyContact2).



I have created data entry views for Country and Medical Condition
without error, and have even added some hotkeys to make the data entry
easier. I can even enter the Country codes and Medical Condition ID's,
and the various self referentials, and these are all enforced by the SQL
Server.



What I am then trying to do is add some ComboBoxes (Dropdown boxes) that
display the Name field and have a value of the ID field for their
respective foreign key. But when I try to add the ComboBoxes and attach
the data, the are not looking up the data (If I use the Preview Data
option it works perfectly).



I have attempted to add another BindingSource, for Country. The
DataMember is Country, DataSource is wingFlexClientDataSet. This is the
same DataSet that is being used for the customerBindingSource that
works. wingFlexClientDataSet is a DataSet that includes the complete
Client Schema, which includes Customer, Country, and MedicalCondition.



When I then set up a Data Binding for the DataSource
FK_Customer_Country, which has the Customer.Country Foreign Key linked
to the Country.CountryID Primary Key. The DisplayMember is Country, and
the ValueMember is Country. Under (DataBindings), the SelectedValue is
customerBindingSource. One thing that I have noticed is that the
ValueMember and DisplayMember can only be set to the fields within the
Customer BindingSource, even with the Data Binding set to a field in the
Country table (FK_Customer_Country).



However, even with the above setup, which so far as I can tell is
correct, the combobox displays as blank. Nothing is displayed, and
nothing is selectable.



I can't think of a way to send a copy without posting the complete
solution (which I have replicated in a 1.12MB test solution) as it
doesn't involve any non IDE generated code. Even if I did post the
solution, the Database would still be missing, and I presume this would
be a problem.



Any idea what is going wrong?



Regards,

Wingot
 
S

Steven Cheng[MSFT]

Hi Wingot,

Just inform you that I've updated you in the old thread on this databinding
issue. For your convenience, I've pasted the reply here also:

========================
For the further scenario you mentioned, my understand is that you now let
the wingFlexClientDataSet return tree tables(with relations) and then bind
each of them to different dropdownlist (via setting DataMember), but found
the dropdownlist doesn't get populated,correct?

Would you confirm the following things:

** are you purely use datasource control(no extra code) for the databinding

** for the value you set to the dropdownlist's "DataTextField" and
"DataValueField" are set to the correct column field name(in the certain
table in DataSet), these columns should not be any column in other
table(linked by the original table) since ASP.NET databinding does not
support automatically linked multipe table through relation.

You can also try creating a simple aspx page and put the dropdownlist and
datasource control at top level to see whether it can works. If that also
not work, we can first concentrate on such a simplified page.

BTW, I've seen your another new thread posted. Do you think it proper that
we continue discuss here or in that one?

========================================

You can choose either one for us to continue discuss on this problem.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

==================================================


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


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top