Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ??

Sometimes you´ve got to make a silent Takedown .
Posted

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

Posted

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:

Sometimes you´ve got to make a silent Takedown .
  • *Experts*
Posted

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

"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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...