[VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sources
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sources

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Posts
    4

    [VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sources

    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 IDtable21 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 table21 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.

  2. #2
    Join Date
    Oct 2006
    Posts
    181

    Re: [VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sour

    Your database doesn't seem like it's designed very well. I'm surprised what you have is working at all. However, if it is correctly updating your db then your only problem is the bound controls aren't showing the new values after insert/update. Is that correct?

  3. #3
    Join Date
    Dec 2008
    Posts
    4

    Re: [VB.NET 2005][ADO.NET] Problem on complex Combobox Binding between different sour

    Yes the problem it's correctly that, and offcurse it's possible the database it's not so correctly designed, I am just a noob Anyway any suggestion for solving this problem ? I read a million of faq around and seems I am not the only one with that kind of problem with combobox it's currect that ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center