[VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sources, I need some help please

vb.net , ado.net , sql express 2005 Vicenza, Italy
  • 12 years ago
    First of all sorry to everyone for my bad english but I will try to explain the situation in the best way I can. The scenario it's one database with 3 tables, table1 with ID and Description, table2 with ID and Description, table3 it's build like that: ID, IDtable1, description, value, IDtable2, IDtable2_1, date, timestamp In my form I have a Datagridview binded with the bindingsource connected to table3, as well as a bindingnavigator and some textbox. The view on Datagridview it's little particular becuase I never show the IDTable1 or IDtable2 or IDtable2_1 but instead from the sql join expression I put the description corresponding to the IDs. On the upper part near the textbox I put 3 combobox, they have to be binded to the same bindingsource as datagridview but they must be filled with the content of table1 table2 and table2_1 so if I select the first value of combobox1 they show me text as text1 and value as id1. The problem is here, I am not able to execute a binding of my combobox in that way, as per example if I press on bindingnavigator the betton for ADDNEW record on datagridview I starting with the problem, I can add the new record and choose the right value from the combobox but when I press the save button and everything finish on the database on the datagridview the value added to the datarow seems to be only the textbox and checkbox binded to the table3 but the value from combobox1 combobox2 and combobox3 never saved on the datarow (but if I check the database the ID corresponding to the select I make it's saved correctly but the datarow never update with the currect description connected to the ID) The same if I edit the row, if I choose the value on Combobox they never update the description on the datagridview but it's everything saved correctly to the database, so how can I solve the problem ???? Is there a way to solve that kind of problem or is better to fill combobox in different way maybe with a reader ??? for each table 1 table 2 and table 3 I have a different dataset, a different dataadapter and a different bindingsource, maybe it's better to use the datarelation that I never used ??? Thanks in advance for any help.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” - Bjarne Stroustrup