UPDATE is not

Have VB.NET program

Used datset wizard, adapter wizard etc to set the stuff up.

I have code that adds rows to the one table in the dataset.
Then it updates the database, SQL
Except, when one queries the database/table there is nothing added to the table.

code to add rows

and if I step throw it, the rows do in  fact get added, column values filled etc.

Have:
Dataset.AcceptChanges
SQLDataAdapter.UpdateCommand.Connection.Open

Try
 SQLDataAdapter.Update(Dataset)
'actually tried various forms, overloads - no differences

Catch e As 'well one issue - which type of error to catch for
MsgBox(whatevererror is can catch)
end try

SQLDataAdapter.UpdateComman.Connection.Close

What happens as above, is no errors, no fouls.
Except, actually NO DATA gets written to the database.

If I comment out "...acceptchanges"
Then I get DBConcurrencyException
with no additional info.

As each datarow is unique - else I'd get errors adding/changing them during processing
Plus I have double checked that at the Try and they are in fact unique
The DBConcurrencyException tells me, and gee this is helpfull:
DBConcurrencyError
(0) rows affected.

Like that is helpful.

BTW: Right now there is nothing in the table on the database
But I use to have data (this table serves as temporary table, so once finished processing it deletes the data)
Point being I know the table works - is structured properly.

Any ideas?

Thanks.
tlfeetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hammadian2Commented:
if you're binding the dataset to a certain control
then u'll have to first call the EndEdit method of the control before trying to update data

if you're 100% sure that your code is correct, then try updating the framework to 1.1
0
tlfeetAuthor Commented:
Hi Hammadian2

re: "if you're binding the dataset to a certain control"

I am not binding this particular dataset to any controls.
But maybe I still need to do the begin/end edit routine?

re: "f you're 100% sure that your code is correct, then try updating the framework to 1.1"
Not 100% sure ... which is why I am posting. ;)
I am at 1.1

Thanks for ideas.
0
Hammadian2Commented:
post ur code
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tlfeetAuthor Commented:
"post ur code"

Hi Hammadian2 - all of it?  All 600,000 lines - vast majority not having anything to do with UPDATE ;)
Seriously, what part?

Update is as above.

Private Sub()
Dataset.AcceptChanges
SQLDataAdapter.UpdateCommand.Connection.Open

Try
 SQLDataAdapter.Update(Dataset)
'actually tried various forms, overloads - no differences
 ' e.g. SQLDataAdapter.Update(Dataset, TableName) etc.

Catch e As 'well one issue - which type of error to catch for
'right now I have it set to catch DBConcurrencyException
'but have tried other errors
MsgBox(whatevererror is can catch)
End try

SQLDataAdapter.UpdateComman.Connection.Close
End Sub

If I have it as above, step thru, can check yes, indeed has rows, each row unique, etc.
Get to " SQLDataAdapter.Update(Dataset)" it does it, does not go into catch, does not throw some other error, but does not write to DB.

If I comment out "Dataset.AcceptChanges"
Then I get DBConcurrencyException Error
(0) Rows affected.

What other code are you looking for?
0
tlfeetAuthor Commented:
Problem stemmed from had a AcceptChanges line elsewhere in code (leftover from debuggin previously).
Which caused DBConcurrencyException, error.

Couldn't determine how to get more info out the Exception properties, methods.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.