473,327 Members | 2,025 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,327 software developers and data experts.

Updatring VFP database

Hello,

I write a small program to build a web service. I fill a dataset with data
from VFP database. After I put a record in the dataset and make the update.
When updating the database I get an error described like this:
"System.NullReferenceException: Object reference not set to an instance of an
object.

at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at VT_HRSWebServices.HRSService.UpdateObservation() in
C:\Inetpub\wwwroot\VT_HRSWebServices\HRSService.as mx.vb:line 171"
The instruction where it fails is: HRSAdapterObs.Update(DSObs, "observation")
I don't know what to do to resolve this error.

Bye

Here is the code:

HRSAdapterObs.Fill(DSObs, "observation")
LNewRow = DSObs.Tables("observation").NewRow
With LNewRow
.Item("round") = 1250
.Item("date") = Today
.Item("begin_time") = "10:20"
.Item("end_time") = "10:25"
.Item("entry_date") = Today
End With

DSObs.Tables("observation").Rows.Add(LNewRow)

LRowsUpatedCount = 0
Try
HRSAdapterObs.Update(DSObs, "observation")
LRowsUpatedCount = LRowsUpatedCount + 1

Catch e As Exception
Return -1
End Try

Return LRowsUpatedCount
Nov 21 '05 #1
1 1009
Hi,

I am guessing that you never created an updatecommand for the
dataadapter. Take a look at the command builder class.

http://msdn.microsoft.com/library/de...andbuilder.asp
Ken
---------------------
"Billy Yang" <Bi*******@discussions.microsoft.com> wrote in message
news:42**********************************@microsof t.com...
Hello,

I write a small program to build a web service. I fill a dataset with data
from VFP database. After I put a record in the dataset and make the update.
When updating the database I get an error described like this:
"System.NullReferenceException: Object reference not set to an instance of
an
object.

at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String
srcTable)
at VT_HRSWebServices.HRSService.UpdateObservation() in
C:\Inetpub\wwwroot\VT_HRSWebServices\HRSService.as mx.vb:line 171"
The instruction where it fails is: HRSAdapterObs.Update(DSObs,
"observation")
I don't know what to do to resolve this error.

Bye

Here is the code:

HRSAdapterObs.Fill(DSObs, "observation")
LNewRow = DSObs.Tables("observation").NewRow
With LNewRow
.Item("round") = 1250
.Item("date") = Today
.Item("begin_time") = "10:20"
.Item("end_time") = "10:25"
.Item("entry_date") = Today
End With

DSObs.Tables("observation").Rows.Add(LNewRow)

LRowsUpatedCount = 0
Try
HRSAdapterObs.Update(DSObs, "observation")
LRowsUpatedCount = LRowsUpatedCount + 1

Catch e As Exception
Return -1
End Try

Return LRowsUpatedCount

Nov 21 '05 #2

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

Similar topics

0
by: Cherrish Vaidiyan | last post by:
sir, The following are the steps that i followed in setting up standby database on Red hat Linux 9. i am using Oracle 9i. i have followed the steps in this site : ...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
8
by: Kamlesh | last post by:
Hi, How do I know the physical database path of a database. When I goto the DB2INSTANCE users's directory (/home/db2inst1), I see following folders: /db2inst1/NODE0000/SQL00001...
1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
8
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well....
0
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
1
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...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.