Windows Develop Bookmark and Share   
 index > Windows Forms General > ComboBox Binding Problem
 

ComboBox Binding Problem

Hi

I always receive the following exception

System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>nDMS.vshost.exe</AppDomain><Exception><ExceptionType>System.ArgumentException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Child list for field Company cannot be created.</Message><StackTrace> at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
at System.Windows.Forms.ListControl.SetDataConnection(Object newDataSource, BindingMemberInfo newDisplayMember, Boolean force)
at System.Windows.Forms.ListControl.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.set_BindingContextInternal(BindingContext value)
at System.Windows.Forms.Control.set_BindingContext(BindingContext value)

I think the problem is cause by ComboBox not being able to bind to any column name that have a dot character in them. Unfortunately the column name must have the dot because of SQL stuff.

Is there another way to prevent make this work?

The column name is "Company.fullname"

The data source of combobox is a datatable.

base.DataSource = tableData; //tableData is DataTable class.
base.DisplayMember = table.getName(display);
base.ValueMember = table.getName(table.binding);

Thanks,

Max

o00oo00o  Tuesday, July 17, 2007 8:32 AM

The only way to prevent this is to change any column name so it does not have any dot character.

Windows Form hate the dot character.

Regards,

Max

o00oo00o  Wednesday, July 18, 2007 1:00 AM

The only way to prevent this is to change any column name so it does not have any dot character.

Windows Form hate the dot character.

Regards,

Max

o00oo00o  Wednesday, July 18, 2007 1:00 AM

You can use google to search for other answers

Custom Search

More Threads

• Problem with SoundPlayer PlaySync () method
• hotspot type links on picture box controls
• Problems with RichTextBox
• How Can I handle Mouse events over a Form with Trancperancy Key ?
• Diagram Control/SDK
• Printing
• Flashing application title
• TypeConverter and UITypeEditor in PropertyGridManger
• How do you create a hisotory and/or favorites list for a WebBrowser Control?
• Problem with Drag and Drop Datagrid Code from MSDN