Click here to Skip to main content
13,092,725 members (65,364 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I have a database, with 5 tables, for my question i just need 2 to explain
my situation.

One is: AUFK
Second is: AUFP

In my form, AUFK is ment my adding a new ordernnumber(PK), the User who ordered and the date. This are Detailed View -> Textboxes and have the same bindingsource -> AUFK.

Now i have added into AUFK, the datatable AUFP, this is going by dataset. So i
get a datagridview from AUFP, from AUFK.

AUFP is just, if a User have already AUFK entries, it should display them, when you validate the AUFK Number Textbox in the form.

What i have done till now:

-creating the adapter for that table

private Data.lehrlingDataSetTableAdapters.NV_AUFKTableAdapter AUFKAdapter = new Data.lehrlingDataSetTableAdapters.NV_AUFKTableAdapter();

- i filled the datatable on load:

- i set the proper settings in the datatabledesigner for the relations, but now i dont know how to use the datatableadapter right. If i validate the AUFK number box, if the number exists that it should fill my gridview AUFP.

Thank you for evtl. help!

Greets niko
Posted 2-Dec-12 22:26pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Now you will go by this :
Suppose, you want only AUFK id numbers, the code is as below;
foreach(DataRow dr in lehrlingDataSet.NV_AUFK)

This is just a sample, make changes according your requirements.. Good Luck :)
niko_tells 3-Dec-12 4:38am
i dont think that this gonna work, but nice idea! I need in the AUFK->AUFP table the whole row (if the number exists) from AUFP. AUFK has an "id" and AUFP has an "id", now if the textbox shows one that exists, the datatable(aufp) should fill the rest of informations that AUFP contains. But thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100