|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Relation between 2 tableLets say i've 2 table. Order and OrderDetail.
Order table is contain OrderNo(PK), OrderName. orderDetail contain orderDetailID(PK), OrderNo(FK), item and qty. and i had finish related the two of table in dataset. Is it possible that the value of orderNo (from orderDetail table) insert automatically from his foreign key (Order.OrderNo) ? Thanks. Hi Seth,
I am not sure I understand you completly. Can you explain in more details what do you mean by "inserrt automatically from his foreign key (Order.OrderNo) " -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Seth Bourne" <Seth Bou***@discussions.microsoft.com> wrote in message news:0490145A-2944-4147-BBB4-839B4C1356CC@microsoft.com... > Lets say i've 2 table. Order and OrderDetail. > > Order table is contain OrderNo(PK), OrderName. > orderDetail contain orderDetailID(PK), OrderNo(FK), item and qty. > > and i had finish related the two of table in dataset. Is it possible that > the value of orderNo (from orderDetail table) insert automatically from > his > foreign key (Order.OrderNo) ? > > Thanks. Hi Miha,
The orderDetail Table consist foreign key from Order table. The coloumn name is OrderNo (orderDetail.OrderNo). if i'm insert 1 row into orderDetail, is it possible to automatically update the orderNo from orderDetail table, same as the orderNo from Order table ? the mean 'automatically' it's mean we dont have to code anything, just related it to the dataset relation. |-----------------------| OrderDetail ||------------------------------| | Order | | |-----------------------| qty ||------------------------------| | OrderNo (PK) | -----------------| | OrderDetailID (PK) | | OrderName | |----- | OrderNo (FK) | |-----------------------| | Item | | Show quote |------------------------------| "Miha Markic [MVP C#]" <miha at rthand com> wrote in message news:4F692A43-0E71-43D8-965F-4C1B744AA635@microsoft.com... > Hi Seth, > > I am not sure I understand you completly. > Can you explain in more details what do you mean by > "inserrt automatically from his foreign key (Order.OrderNo) " > > -- > Miha Markic [MVP C#, INETA Country Leader for Slovenia] > RightHand .NET consulting & development www.rthand.com > Blog: http://cs.rthand.com/blogs/blog_with_righthand/ > > "Seth Bourne" <Seth Bou***@discussions.microsoft.com> wrote in message > news:0490145A-2944-4147-BBB4-839B4C1356CC@microsoft.com... >> Lets say i've 2 table. Order and OrderDetail. >> >> Order table is contain OrderNo(PK), OrderName. >> orderDetail contain orderDetailID(PK), OrderNo(FK), item and qty. >> >> and i had finish related the two of table in dataset. Is it possible that >> the value of orderNo (from orderDetail table) insert automatically from >> his >> foreign key (Order.OrderNo) ? >> >> Thanks. > Are you talking about UI or code - how are you inserting rows?
If you are inserting by code then you shouldn't have problems passing OrderNo from Order table as you have to know it. -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Seth Bourne" <seth***@yahoo.com> wrote in message news:e2UJcY3HHHA.1912@TK2MSFTNGP03.phx.gbl... > Hi Miha, > The orderDetail Table consist foreign key from Order table. The coloumn > name is OrderNo (orderDetail.OrderNo). > if i'm insert 1 row into orderDetail, is it possible to automatically > update the orderNo from orderDetail table, same as the orderNo from Order > table ? > the mean 'automatically' it's mean we dont have to code anything, just > related it to the dataset relation. > > |-----------------------| |------------------------------| > | Order | | > OrderDetail | > |-----------------------| |------------------------------| > | OrderNo (PK) | -----------------| | OrderDetailID (PK) > | > | OrderName | |----- | OrderNo > (FK) | > |-----------------------| | Item | > | > qty | > > |------------------------------| > > > "Miha Markic [MVP C#]" <miha at rthand com> wrote in message > news:4F692A43-0E71-43D8-965F-4C1B744AA635@microsoft.com... >> Hi Seth, >> >> I am not sure I understand you completly. >> Can you explain in more details what do you mean by >> "inserrt automatically from his foreign key (Order.OrderNo) " >> >> -- >> Miha Markic [MVP C#, INETA Country Leader for Slovenia] >> RightHand .NET consulting & development www.rthand.com >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/ >> >> "Seth Bourne" <Seth Bou***@discussions.microsoft.com> wrote in message >> news:0490145A-2944-4147-BBB4-839B4C1356CC@microsoft.com... >>> Lets say i've 2 table. Order and OrderDetail. >>> >>> Order table is contain OrderNo(PK), OrderName. >>> orderDetail contain orderDetailID(PK), OrderNo(FK), item and qty. >>> >>> and i had finish related the two of table in dataset. Is it possible >>> that >>> the value of orderNo (from orderDetail table) insert automatically from >>> his >>> foreign key (Order.OrderNo) ? >>> >>> Thanks. >> > > |
|||||||||||||||||||||||