473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

oledbadapter Question !

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

Nov 16 '05 #1
1 1810
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.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

"msnews.microsoft.com" <ag*****@nobel-systems.com> wrote in message
news:eK*************@TK2MSFTNGP15.phx.gbl...
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


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ivaylo | last post by:
I use OleDbAdapter to fill my dataset from Access database and tables with autoincrement id columns.Also i created xsd schema for my dataset The problem is that the dataset automatically add neu...
0
by: Karl | last post by:
Hi all, I know I can use Adapter Wizard in forms to create adapter. But, in order to make the code better structured, I want to create a dataset and some OleDbadapters in a class file. So I cannot...
0
by: roiavidan | last post by:
Hi, I'm having a bit of a problem with a small application I wrote in C#, which uses an Access database (mdb file) for storing financial data. After looking for a similiar topic and failing to...
0
by: Pavel Gusak | last post by:
I'm trying to update Access database with data from DataSet in my Web Service. Does not work. Generates Concurrency violation error, however, nobody works with db at the time. Can you help me?...
5
by: Aries | last post by:
I have a connection string like this, anyone know how can I fix it? <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <html> <body> <!-- #include file =...
0
by: Erik | last post by:
I have a Form that has 2 OleDbAdapters and one dataset object. In the dataset I have two tables that are joined. My datagrid is looking at one table. I add new records to the datagrid. I want to...
2
by: Mike | last post by:
I'm working on an application that will add, update, and delete movies. I'm able to update or delete multiple records from the dataset and then successfully update the "Movie" table. However I...
4
by: Engineerik | last post by:
I want to create a datatable from a text file. Currently I open the file as a textstream and read one line at a time. After reading each line I create a new row for my table and parse the line to...
9
by: bill | last post by:
Does anyone see why I'm getting this message? It errors out on line 5 at "assAdapter"? Dim Con = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;" & "data...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.