Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I receive some values from table, bind it to a combobox, now, to convert it to the table format is a poblem because of the datetime format in the data received from the database.
ProcessingTB processvalue=(ProcessingTB)cmbTranscationdate.SelectedValue;
Posted
Comments
[no name] 4-Sep-13 11:10am    
And you expect us to know what it is that you are talking about from just this? What "table format"? What datetime format? Why is it that you cannot change the format? What errors do you get? We can't see your code or read your mind.
Mahesh Bailwal 4-Sep-13 11:20am    
Share your code.
Corporal Agarn 4-Sep-13 11:52am    
Please show examples.

1 solution

ProcessingTB value = (ProcessingTB)cmbTranscationDate.SelectedValue;

Error Message:
System.InvalidCastException was unhandled by user code
Message=Unable to cast object of type '<>f__AnonymousType1`2[System.DateTime,System.Int32]' to type 'IntSalCom.ProcessingTB'.
Source=IntSalCom
StackTrace:
at IntSalCom.ItemList.cmbTranscationDate_SelectedIndexChanged(Object sender, EventArgs e) in C:\Users\DOvercomer\Documents\Visual Studio 2010\Projects\IntSalCom\IntSalCom\ItemList.cs:line 115
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at System.Windows.Forms.ComboBox.RefreshItems()
at System.Windows.Forms.ComboBox.OnDataSourceChanged(EventArgs e)
at System.Windows.Forms.ListControl.SetDataConnection(Object newDataSource, BindingMemberInfo newDisplayMember, Boolean force)
at System.Windows.Forms.ListControl.set_DataSource(Object value)
InnerException:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900