Need some huuuuge help, please!

Hi,

If you have an SQL Database and in it 2 tabels,and on the main form you put both tabels, Clients and Reservations, with all their columns and I want to see every client with its reservation, how do you make all the connextions to work Besides binding every textbox that will be on that form with one of the 2 tabels, I have to write some code to work

Thank you

Regards,




Answer this question

Need some huuuuge help, please!

  • Grimmo

    that depends on the controls that you gonna use for example

    do you want to use combobox for clients or datagridview

    i guess reservations will be in datagridview anyway

    hope this helps



  • Marcel Andrade

    Yes, the reservations will be datagridview, but for the client table I use only textboxes. But anyway, if I use instead comboboxes, how would I have to do

    Regards,



  • Alex95

    Ankit Nagpal wrote:

    hi

    r u talking abt window forms..if so there is a control called tabcontrol...

    and if any other thing...please post the full problem

    Hi,

    Yes, I am talking about window forms, I put 3 tabs on a form and I have 2 radiobuttons on the first tab, and when I choose one of those radiobuttons, I want to jump to one of the other 2 tabs left. But how can I do that in code I can't find a property or something usefull.

    Thank you

    Regards,



  • Jonathan Aneja - MSFT

    Thank you, you really helped me a lot. I found the problem and now it works. But now I have another problem: do you know how to switch tabpages on a form, to become on top

    Regards,



  • James1299

    hi,

    actualy i have tried to do what you are talking about , i saw it in MsAccess database its a property called lookup that will allow you to replace the id's in your ForeignKey field with names from a higher level table in the relation,

    but i didn't found it in datagridview yet . so i use combobox or textbox to display the parent table and datagrid to dispaly the child table ,  open edit columns in datagridview and hide the ForeignKey column

    hope this helps



  • new to .NET

    hi,

    i'm talking about MS Access its different than sqlserver during designing your database this property is exist its something internal in Access i was trying to imitate this property in my datagridview but i didn't know how, i didn't say its exist in vs2005

    best regards



  • Khanh.p

    Thank you for trying to help me, but I forgot to mention that I am using SQL Server 2005 and .NET 2005 and as far as I know there are a lot of changes. I can't find that property you were talking about. But I am still trying to find out how this can be done.

    Regards,



  • DOSST

    hi

    r u talking abt window forms..if so there is a control called tabcontrol...

    and if any other thing...please post the full problem


  • jp153

    hi,

    i assume you build your database allready and you have a relationship between the two tables

    click data menu >> show datasource

    in your datasource panel

    select your clients table it will show the table name as combobox select detail from that combobox, then drag the table to your form designer

    2) at the end of your clients table after the last field you will find your reservations table as a subnode to your clients table ( don't take the reservations table in the root) select it and chose datagridview from the combobox then drag it to your designer

    you are done, now you have every thing working

    hope this helps



  • Richard98045

    Ok, but if I want to put there only the reservation table and for each reservation I want to see the name of the client. I have the number of the reservation as a primary key, and the client code as a foreign key to clients table. And I put these 2 on my form, how can I do to see only the client name in the client code combobox for each reservation I tried to put in the Data Source the clients BindingSource, in Display Member the clients.clientname and in the Value Member clients.clientcode but it still shows me only their code not the name.

    Regards,



  • sreekanthr

    Ankit Nagpal wrote:

    hi

    r u talking abt window forms..if so there is a control called tabcontrol...

    and if any other thing...please post the full problem

    Hi,

    Yes, I am talking about window forms, I put 3 tabs on a form and I have 2 radiobuttons on the first tab, and when I choose one of those radiobuttons, I want to jump to one of the other 2 tabs left. But how can I do that in code I can't find a property or something usefull.

    Thank you

    Regards,



  • Héctor

    on radio button check disable the current tab and enable the tab u want

    im pasting the code below.. let me know if u still face any problem

    private void radioButton1_CheckedChanged(object sender, System.EventArgs e)

    {

    tabControl1.SelectedTab = tabPage2;

    }


  • Need some huuuuge help, please!