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

urgent! dataset updation in wrong row

hi.

ive been using a certain code for updating information from a windows form
to an Access database , and it was handling the addition of new information
properly until now.

now suddenly the dataset seems to be reordering the rows in an arbitrary
fashion, and since i use

ds.tables("form1").rows(ctr-1).item(*column name*)

to add the data, the information keeps getting added to the wrong row.
moreover, the program picks one row and keeps overwriting the information
ONLY to that one row no matter how many new rows i create, which makes it
weirder still because the variable ctr is defined as

ctr = ds.tables("form1").rows.count

i dont have any constraints on my sql select statement when i access the
database - no order by or sort by.ive also checked my code several times to
see if ive reassigned the ctr value anywhere but i havent, so thats not the
problem.

can someone please help?

thanks in advance.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200606/1
Jun 16 '06 #1
4 1338
how tragic, nobody knows?! :(

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200606/1
Jun 16 '06 #2
m.ra,
Sounds like a primary key was added to the DataTable, and you are modifying
one of the key fields. However I have not tested this to confirm it.

Can you post a small but complete program that demonstrates the problem?

http://www.yoda.arachsys.com/csharp/complete.html
One possible way to avoid the problem:

Rather then use the rows indexer to get to the row:
| ds.tables("form1").rows(ctr-1).item(*column name*)

I would put the row in a variable, then modify the row from there.

Dim row As DataRow
row = ds.tables("form1").rows(ctr-1)

row.item("column1") = 1
row.item("column2") = 2
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"m.ra. via DotNetMonster.com" <u16975@uwe> wrote in message
news:61d8785f00d9a@uwe...
| hi.
|
| ive been using a certain code for updating information from a windows form
| to an Access database , and it was handling the addition of new
information
| properly until now.
|
| now suddenly the dataset seems to be reordering the rows in an arbitrary
| fashion, and since i use
|
| ds.tables("form1").rows(ctr-1).item(*column name*)
|
| to add the data, the information keeps getting added to the wrong row.
| moreover, the program picks one row and keeps overwriting the information
| ONLY to that one row no matter how many new rows i create, which makes it
| weirder still because the variable ctr is defined as
|
| ctr = ds.tables("form1").rows.count
|
| i dont have any constraints on my sql select statement when i access the
| database - no order by or sort by.ive also checked my code several times
to
| see if ive reassigned the ctr value anywhere but i havent, so thats not
the
| problem.
|
| can someone please help?
|
| thanks in advance.
|
| --
| Message posted via DotNetMonster.com
| http://www.dotnetmonster.com/Uwe/For...b-net/200606/1
Jun 16 '06 #3
M.R.

Is it right that the forelast row is continuasly overwriten, that is what
your code in my idea tells.

Cor

"m.ra. via DotNetMonster.com" <u16975@uwe> schreef in bericht
news:61d8785f00d9a@uwe...
hi.

ive been using a certain code for updating information from a windows form
to an Access database , and it was handling the addition of new
information
properly until now.

now suddenly the dataset seems to be reordering the rows in an arbitrary
fashion, and since i use

ds.tables("form1").rows(ctr-1).item(*column name*)

to add the data, the information keeps getting added to the wrong row.
moreover, the program picks one row and keeps overwriting the information
ONLY to that one row no matter how many new rows i create, which makes it
weirder still because the variable ctr is defined as

ctr = ds.tables("form1").rows.count

i dont have any constraints on my sql select statement when i access the
database - no order by or sort by.ive also checked my code several times
to
see if ive reassigned the ctr value anywhere but i havent, so thats not
the
problem.

can someone please help?

thanks in advance.

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200606/1

Jun 16 '06 #4
hi! thanks very much for responding.

after breaking my head over it the whole weekend, the problem is fixed. just
in case someone else is struggling with the same thing, here's what i did:

the data adapter wasnt (for some unfathomable reason) able to find the
updated version of the row it correctly updated a few moments earlier. the
trick is to juggle with the linking to the database and allowing the dataset
to reload. i just closed connection and reopened - and that fixed the
concurrency issue.

i still dont know why the dataset loads haphazardedly, and picks only one
"favourite" row. so i fixed a datetime on the first upload of information,
saved it and searched for that particular datetime to find the correct row
again for the second update.

so there. it doesnt explain why it all (mal)functions like that, but hey, at
least the desired result's achieved huh :)

cheers!

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200606/1
Jun 19 '06 #5

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

Similar topics

3
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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,...
0
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...

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.