473,796 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("form 1").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("form 1").rows.cou nt

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.c om
http://www.dotnetmonster.com/Uwe/For...b-net/200606/1
Jun 16 '06 #1
4 1350
how tragic, nobody knows?! :(

--
Message posted via DotNetMonster.c om
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("form 1").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("form 1").rows(ctr-1)

row.item("colum n1") = 1
row.item("colum n2") = 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.c om" <u16975@uwe> wrote in message
news:61d8785f00 d9a@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("form 1").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("form 1").rows.cou nt
|
| 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.c om
| 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.c om" <u16975@uwe> schreef in bericht
news:61d8785f00 d9a@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("form 1").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("form 1").rows.cou nt

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.c om
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.c om
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
2444
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 actually the name of a form element on the parent window. On the new page, I have this javascript: ---- var var2 = location.search.substring(9); document.write(var2)
9
4319
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 data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
8
5266
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 developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
28
3069
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
7
7259
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" id="d_links"> multiple <a href="hello.aspx?q=something">something</a><a href="hello.aspx?q=something1">something1</a><a
33
3443
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
2786
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 partially in c and partially in fortran. I guess i need to change host specific files to make it working. I wonder if standard header files are going to change in this case.my current windows compiler doesn't have sys/resource.h but unix compiler...
1
1929
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 socket. some time error is---"An existing connection was forcibly closed by the remote host" and some time error is--- "A connection attempt failed because the connected party did not properly respond after a period of time, or established...
3
6477
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 the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
7
5992
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 it? If not, how do I have to change my deployment strategy? Thanks!
0
9673
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
9524
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
10449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9047
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6785
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
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
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
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.