oledbadapter Question !

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi All,

I need some help in adding the OledbDataAdapter Insert Command Parameter.

I have two datasets.

1. SourceDataset
2. DestinationDataset

I need to copy rows from the Source into the Destination Table.

I am using the Insert Command.

The confusing part is setting up the Source Column Value.

For Example :

TheDestinationInsertCommand.Parameters["@FACILITYID"].SourceColumn =
"FACILITYID" ;


Here, I presumed this "FACILITYID" is the Source Column from where the data
values should come from.

But there is no way of telling the system this "FACILITYID" column is presnt
in the table found in the Source Dataset.

The System always looks it in the current Destination Dataset and throws an
exception saying:

"Default Value not present for @FACILITYID".

My question is how will tell the system that the "FACILITYID" comes from the
Source Table and do not look for it in the Destination Table.

Thanks for your time.

Regards
Anand Ganesh
 
Hi,

If you want only to copy data between datasets then you don't need an
adapter.
Just copy each row from source to destination.
 
Back
Top