Results 1 to 3 of 3

Thread: Databases and TabControls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    124

    Databases and TabControls

    Hey duders, here's the situation...

    I have a hardware database (Access). In this database I have many, tables, but we'll limit it to two for this discussion. Currently there aren't any relationships in the database.

    I have a table "Servers" and a table "Cabinets". Mulitple servers can be located in one cabinet(Many-To-One Relationship).

    I have two DataAdapters, entitled ServerAdapter and CabinetAdapter. Also, i Have one dataset, DsTest1.

    I am displaying the data in seperate tabs, one for servers and another for cabinets. The data is already filling the appropriate text boxes, and changing from one peice of data to another has all been established.

    Here's the prob...

    When i browse thru the data on the server tab, that servers appropriate cabinet is shown in a text box. When i click the Cabinets tab, i want that cabinet's data displayed(the one from the textbox on the server tab).

    I'm not familiar with db's so if anyone could help it would be great.

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    Save the id/name of the selected servers in a variable. Then in the selectedindexchange event(i think haven't got .net open at the mo) of the tab control pass that variable in a parameter to your database and get the info on the cabinet to display
    Wind and waves resolves all problems.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2003
    Posts
    124
    As I said in the original post im not familiar with Databases

    I've saved the variable in a String

    How do i pass it to the database and get the pertinent data displayed?

    I think i have to execute an SQL statement, but im not sure, and dont know the syntax.

    heres the setup

    Table that i want to search = Cabinets
    string Variable with the Cabinet Name required = strCabinetName
    Database Name = Hardware


    any help would be great.

    thanks in advance

    dave.

Posting Permissions

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



Click Here to Expand Forum to Full Width