473,769 Members | 4,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OleDB update command ?

I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?

Johan

Nov 15 '05 #1
5 13558
Maybe posting the code that causes the error would help ? Its easier to
diagnose that way...JMHO
--
-------------------------------------------------------
http://www.qnal.net/inkabletype

"Sagaert Johan" <RE************ *@hotmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?

Johan

Nov 15 '05 #2

"Sagaert Johan" <RE************ *@hotmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?


There are two things i can think of (at least, that i ran into them myself):
1. You have an autonumber column in the table, but the MissingSchemaAc tion
property in the data adapter is set to Add, but not AddWithKey.
2. Your table comes from a query, so it's not possible to update the tables
that the data came from.

Miki
Nov 15 '05 #3
I will prepare one and post it.

I am using the design time components on my form.

One of the exceptions i had said i was missing the insert command in the
oledbdataadapte r.
This might be were i got stuck with.

"Kunal" <kunal.das[AT]removethis.qnal .net> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Maybe posting the code that causes the error would help ? Its easier to
diagnose that way...JMHO
--
-------------------------------------------------------
http://www.qnal.net/inkabletype

"Sagaert Johan" <RE************ *@hotmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?

Johan


Nov 15 '05 #4
I always get an invalid INSERT INTO exception

// Create the DataSet object

DataSet oDS = new DataSet();

OleDbConnection conn = new
OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;Data
Source=domotica 7.mdb");

conn.Open();

// Create the DataTable

OleDbDataAdapte r oOrdersDataAdap ter = new OleDbDataAdapte r(new
OleDbCommand("S ELECT * FROM InOut", conn));

OleDbCommandBui lder oOrdersCmdBuild er = new
OleDbCommandBui lder(oOrdersDat aAdapter);

oOrdersDataAdap ter.FillSchema( oDS, SchemaType.Sour ce);

DataTable pTable = oDS.Tables["Table"];

pTable.TableNam e = "InOut";

// Insert the Data

DataRow oOrderRow = oDS.Tables["InOut"].NewRow();

oOrderRow["Modulenaam "]="testmodule ";

oOrderRow["Omschrijvi ng"] = "informatie ";

oOrderRow["SubAdres"] = 123;

oOrderRow["Zone"] = "badkamer";

oDS.Tables["InOut"].Rows.Add(oOrde rRow);

//this fails

oOrdersDataAdap ter.Update(oDS, "inout");

conn.Close();

"Miki Watts" <mi*****@netvis ion.net.il> wrote in message
news:KM******** ************@gi ganews.com...

"Sagaert Johan" <RE************ *@hotmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?
There are two things i can think of (at least, that i ran into them

myself): 1. You have an autonumber column in the table, but the MissingSchemaAc tion
property in the data adapter is set to Add, but not AddWithKey.
2. Your table comes from a query, so it's not possible to update the tables that the data came from.

Miki

Nov 15 '05 #5
Found the cause:
one of the field names in my access MDB was the name of a .NET class keyword
..

The INSERT INTO systax error exception seriously misleaded me...
"Miki Watts" <mi*****@netvis ion.net.il> wrote in message
news:KM******** ************@gi ganews.com...

"Sagaert Johan" <RE************ *@hotmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I need some example
I have a dataset populeted through a dataadapter fill method
i can add rows to my dataset , but i have an exception when calling the
dataadpters update method.

I already spent 7 hours to solve this, yet i still am no step further.

I might be missing something around the Updatecommand property of the
oleDBDataAdapte r.

Can someone point me to an example or more information ?
There are two things i can think of (at least, that i ran into them

myself): 1. You have an autonumber column in the table, but the MissingSchemaAc tion
property in the data adapter is set to Add, but not AddWithKey.
2. Your table comes from a query, so it's not possible to update the tables that the data came from.

Miki

Nov 15 '05 #6

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

Similar topics

14
3429
by: | last post by:
Hi, I was performing SQL UPDATE queries and I notice that they SUCCEED on the ExecuteNonQuery() call with NO exceptions raised BUT they fail at the Database. They say they succeed in the code but they fail at the database. To fix this they Parameters.Add must be called in the ORDER they are in the SQL STATEMENT. This is confusing and bad.
1
1362
by: Josef Schneider | last post by:
Given: Data.oledb source, and a Data.odbc target The oledb data is read into a dataset. (1) Is there an easy way to copy that dataset to the target datasource ( I can look through the dataset and do INSERT statements, but is there a single command to copy the data to a table ) ?
4
7811
by: NS | last post by:
Hi, I am trying to execute a prepare statement using oledb provider for DB2. The command.Prepare() statement is giving me an exception " No error information available: DB_E_NOCOMMAND(0x80040E0C)." My code is very simple and is working with other oledb provider, like SQL Server and oracle.
2
23941
by: Joe | last post by:
Hi All, I am new to using the Access DB and I need some help if someone is able to give it to me. What I want to do is get the names of the columns of certain tables. Not the data in the table but the table column names. I've seen other posts that suggest using the SQL command DESCRIBE but I can't get it to work for some reason. Other posts have code samples but they're written in VB which I am not familiar with. I
8
1618
by: bob | last post by:
Hi.. I'm making a OleDb connection to a access database.. I can fill the dataset fine and view the data, but when I add a new row and try to update the db I get this error. Any help would be appreciated.. Error: An unhandled exception of type "System.Data.OleDb.OleDbException' occurred in system.data.dll This error is from the following line:
9
4777
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
1
6898
by: T8 | last post by:
I have a asp.net (framework 1.1) site interfacing against SQL 2000. It runs like a charm 99% of the time but once in a while I get the following "unspecified error". Sometimes it would resolve by itself (asp.net recycled?); it also can be solved by restarting IIS. Any ideas what cause(s) this to happen? System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr) at...
0
5675
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at TryThis.Form1.save() in C:\Documents and Settings\Nick\My Documents\...
13
8882
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single transaction. Does anyone have an SQL statement I can throw at it that would accomplish this? If I can't figure out how to do it, I'm going to have to send two discreet SQL commands for each record which will take infinitely longer than a...
2
2116
by: Benedictum | last post by:
I have the following code that derives the value from a query string - // the code -> protected void Page_Load(object sender, EventArgs e) { string theTime = Request.QueryString; string altitude = Request.QueryString;
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.