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

Failing to update dataset into access table. What am i doing wrong?

I have added an access database into my 2005 desktop project, created a
dataset called ResourcesDataSet which contains one of each table in the
database using the wizard. The database was automatically copied from its
source directory into my output directory. I connect to it using
Provider=microsoft.jet.oledb.4.0
One of the tables is called server_id which i dragged from the dataset onto
my form.
Visual studio automatically generated server_idBindingSource,
server_idTableAdapter, server_idBindingNavigator and a data grid on my form.

To insert a record I use the following (server_id is a short, server_name is
a string.)
server_idTableAdapter.Insert(server_id, server_name);
I test server_idTableAdapter.GetData().Rows and find that the row's been
inserted there ok.
After all records are inserted, I call the following believing it's causing
a write to the database.
server_idTableAdapter.Update(resourcesDataSet.serv er_id);
Checking the result of this, I'm receiving 0. The data isnt being committed.
If i check watch window for resourcesDataSet.server_id, Count is only 1 (a
dummy record I entered directly into Access).
resourcesDataSet.server_id.base.Rows.Count is also only 1.
This is the first time Ive ever used these components and the help files
were a bit sketchy.
What SHOULD I be doing please?

A second question.
For the server_id table, for example, I use access 2007 to create an access
2002-2003 mdb database and enter the fields in design mode.
There are 3 fields. ID which is defined as long, server_id which is defined
as an int, and server_name which is defined as a string.
When the database is imported into visual studio, ID becomes an int and
server_id is transposed into a short.
Why is this please?

thank you

Aug 27 '07 #1
0 1186

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

Similar topics

9
by: joun | last post by:
Hi all, i'm using this code to insert records into an Access table from asp.net, using a stored procedure, called qry_InsertData: PARAMETERS Long, Long, Text(20), Long, DateTime; INSERT...
4
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this...
4
by: Jeremy | last post by:
My app is throwing an exception regarding trying to post a null to a required field. Examining the datarow in question, I see a valid date value. The row's state is "added" I'm relying on an ...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
2
by: Computer Guru | last post by:
I imported an Access database, created a dataset, added a bindingsource; and have been happily coding away - couldn't be easier. My problems started when I added a column to the database - I...
0
by: mwenz | last post by:
I am trying to update an Access table using OLEDB in VB.Net 2005. I can add rows but I cannot update them. Code to instantiate the Access database and table... Dim conn As New...
2
by: TBass | last post by:
Hi, We have a process management system in VB .NET. It usually used text files, but I'm trying to switch to using access database files and ADO. I made a form with a datagrid and a few...
13
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.