Mischamel Posted May 12, 2003 Posted May 12, 2003 Hola, I´ve got 3 Tables. Each with an ID as identifier. One of them is the mainTable A, which should be navigateable. While I´m navigating through A, the other 2 tables (B,C) should show the datasets, with the same id as in A. If there´s no equal ID in a or c, the textfields stay clear or show a specific text. I did this before with ADO-Recordsets, but now I´ve got no idea, how it shall work with ADO.NET. Can someone give advice, please ?? Quote Sometimes you´ve got to make a silent Takedown .
ailzaj Posted May 12, 2003 Posted May 12, 2003 You can use the DataAdapter, which has a wizard. This lets you set the connection & write your own SQL statement to select the tables & fields that you need. ailzaj Quote
Mischamel Posted May 12, 2003 Author Posted May 12, 2003 Can u give me a code-example, please ?? I already have a DataAdapter, but i get only @ initialization my table. if i do a 2nd SQL-Statement on it, it doesn´t take effect. OleDbDataAdapter_PAM.SelectCommand.CommandText = "SELECT * FROM PAM Where TicketID = '" & TextBox20.Text & "'" Nothing happens after this. :confused: Quote Sometimes you´ve got to make a silent Takedown .
*Experts* Nerseus Posted May 12, 2003 *Experts* Posted May 12, 2003 I'd get all the data in one DataSet, 3 separate DataTables. You can define relationships in a DataSet between your parent/child tables. If you bind correctly (check the help on binding parent/child tables or relationships), moving a row in one table will automatically update the binding in the child table(s). You could also do what you want manually. Hook an event to the currencymanager (I think, I can't remember which object/even you need - it's positionchanged I think). When the position in the parent table changes, you could create a filtered DataView on your child table and bind your textboxes (or whatever) to that. If you need a third level, hook to the first child's position changed event and ... well, you get it. You might very well be able to do what you want without writing any special filtering code - I'd check out the DataBindings collections and remember that you can bind to a DataTable, DataView, and a relationship (which might be what you want/need). -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Mischamel Posted May 19, 2003 Author Posted May 19, 2003 thanks !!! Quote Sometimes you´ve got to make a silent Takedown .
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.