Insert foreign key
- From: "Irfan" <irfan@xxxxxxxxxxxxx>
- Date: Wed, 7 Sep 2005 11:17:27 +0100
hi,
I am trying to insert data into an MSAccess table through a datagrid. I did
it by creating a custom Insert Command.
However, the table has a foreignKey,which obviously is hidden to the user
(mappingType.hidden) but i tried to pouplate this foreignkey using the code
below, before
running update
//// code in Update_Click button
If ds.HasChanges Then
Dim dt As DataTable = ds.Tables("codegrid").GetChanges(DataRowState.Added)
dt.Rows(0)("filenamefk") = 1 'assume only one row is added and fk =1
End If
///
da.update(ds,tbl)
I can see the table updated in Access but not the fileNamefk.
Is it the correct way to include the data that is not been inserted via
datagrid, but needs to be in table.
Is there any other way to do this.
TIA
Irfan
.
- Follow-Ups:
- RE: Insert foreign key
- From: VN
- RE: Insert foreign key
- Prev by Date: RE: Select not returning any results ??
- Next by Date: Access Linked server generates (Error 7399 / 7312)
- Previous by thread: Application crashing in ODBC at 0x75bb2443 in Windows 2003 SP1
- Next by thread: RE: Insert foreign key
- Index(es):