473,385 Members | 1,973 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,385 software developers and data experts.

How can I dig deeper to find the actual promblem?

VB.NET 2003

I am battling with a specific procedure that does not allow me to update my
data adapter due to an apparent syntax error. I created the data adapter
usign the drag and drop method (from the Server Explorer to the form) by
dragging the table in question to the form and then generating the dataset.

In a procedure I add records to the problem table based on values in other
datagrids in the following way:

Dim drw As DataRow = DataSet51.Tables("InfluenceValues").NewRow()
drw(0) = DataGrid2.Item(DataGrid2.CurrentRowIndex, 0)
drw(1) = DataGrid3.Item(DataGrid3.CurrentRowIndex, 1)
...
drw(9) = 0 '{zero}
drw(10) = 0 '{zero}
DataSet51.Tables("InfluenceValues").Rows.Add(drw)
The added records display correctly in my datagrid and does not raise any
errors. The added records also match the existing records (execpt for one
column which has unique values).

When I (try to) update the data adapter

OleDbDataAdapter8.Update(DataSet51, "InfluenceValues")

I get the error:

System.Data.OleDb.OleDbException
Syntax error in INSERT INTO statement.

The automatically generated INSERT INTO statement reads as follows:

INSERT INTO InfluenceValues (Var1, Var2, Var3, Var4, Var5, Var6, Var7, Var8,
Var9, Var10, Var11) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Adding the exact same record manually into the actual database works
perfect, but even doing it manually into the datagrid gives the same error
when trying to update.

So, the error can't be in the syntax.

Using a error trap and messagbox, I derived the following additional info:

err.source = Microsoft JET Database Engine
err.targetsite = Int32 Update(System.Data.DataRow[],......

The above left me with the idea that it has to do with the 'double' value
columns (numbers) but since the data adapter creates the supporting code
itself, I can't immagine why it wouldn't accept any of the numbers I enter (I
even tried putting the zeros in quotes ("") and also tried setting the value
equal to a value allready in the database table)

How can I get more info to identify the actual problem?
Oct 28 '05 #1
2 1414
Regarding the INSERT statement you posted, are the actual variable name
Var1, Var2, etc?

I suspect that maybe you have a field in your database that is the same
as a reserved keyword. Have you checked this possibility?

Oct 28 '05 #2
Wow - I would never have thought!

No, the var1 etc were only examples.

I changed all the 'suspicious' field names by adding a number and it works
perfectly!! You saved me from a number of sleepless nights!

By the way, whithout me trying them all one by one and recreating the
adapters and dataset again, which one of the following field names could have
been the culpret:

Terrain
Day
Moon
Night

Thanks again!!!
"Chris Dunaway" wrote:
Regarding the INSERT statement you posted, are the actual variable name
Var1, Var2, etc?

I suspect that maybe you have a field in your database that is the same
as a reserved keyword. Have you checked this possibility?

Oct 31 '05 #3

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

Similar topics

16
by: Justin Hoffman | last post by:
This is a question concerning query optimisation. Sorry if it's a bit long, but thanks to anyone who has the patience to help - This is my first post here... If I have two tables:...
11
by: mailar | last post by:
Hi, I am using DB2 version 8.2 on Windows XP platform. I have a table 'EMP' with one field named 'NAME' of type CHAR , size 80. Also , I have a record with NAME='john' Now, when I try to...
5
by: nmtoan | last post by:
Hi, I could not find any answer to this simple question of mine. Suppose I have to write a program, the main parts of it are as follows: #include <blahblah.h> struct {
2
by: PaulNaude | last post by:
VB.NET 2003 I am battling with a specific procedure that does not allow me to update my data adapter due to an apparent syntax error. I created the data adapter usign the drag and drop method...
2
by: SEB | last post by:
can any one please redirect me to how to use control builder class to parse the following case (or any other method) <mycustomcontroltag> <item attribute1="x" attribute2="y" ......> <subitems>...
3
by: shsandeep | last post by:
My data modeler asked me an interesting question... What is better as far as efficiency is considered: Tables having wider columns or deeper rows? I answered: 'It depends' on the total size of...
1
by: murilorc | last post by:
Hi everyone! I need a help to create a perl script that go deeper in a WAP portal do avoid the maximum number of clicks. Today when I access the WAP portal I went to: "Welcome" -> "Videos" ->...
0
by: murilorc | last post by:
Hi everyone! I need a help to create a PHP page/script that go deeper in a WAP portal do avoid the maximum number of clicks. Today when I access the WAP portal I went to: "Welcome page" ->...
14
victorduwon
by: victorduwon | last post by:
Hi guys and gals, I am using javascript to autologin to my google analytics account via a hyperlink. This is what the text looks like this <?xml version="1.0" encoding="utf-8"?>...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.