TIA.........Update problem in Dataset............

  • Thread starter Thread starter Tino Mclaren
  • Start date Start date
T

Tino Mclaren

Hi,

Got a small app based around a access database. In
ADO.net i simply called update method to uptade my
database with dataset contents. i.e.
OleDbDataAdaptor.Update (Dataset.tableName)

Why cant i do this in VS 2005? im using express VB beta.

I have dragged a table from my DB onto design surface, VB
creates DataConnector,DataSet, Table Adaptor &
DataNavigator controls. Looks Fantastic but i cant get my
database updataed.

Any Help appreciated

Tino
 
Tino: (Please, don't take this as criticism) but if I said "Tino, I'm
having problem with an async web service call and reading the dime
attachments" - it would be kind of hard to figure out what the problem is
right - without knowing a little more ;-) the first thign to check is
verify that there are changes presetn in the dataset - right before Update
insert a Debug.Assert(datasetName.HasChanges()); //If this fails, the
problem is there's nothing to sumbit.

check your connection - makes sure that's good - make sure you aren't
try/catching anything and not signalling etc.

if you post the code I'll be glad to do what I can - and honsetly - I was't
trying to lecture with my initial comments - it's just a lot easier to help
you nail the problem down with a little more info.

Cheers,

Bill
 
Bill,

Thank you for the reply. Im new to VB so i'll be expecting to get my
wrists slapped :-/. You are of course right and I should have posted a
bit more. The problem is though - my program at the moment only has
two lines of code because VB 2005 has done all the back room stuff for
me! The 2 lines are :-

on form load - Me.ArtisteTableAdaptor.Fill(Me.AmenDataSet.artiste)
-Generated by VB for me

and I have a Placed a SAVE button on the form and used the following
line of code when its clicked

Button1_Click - ArtisteTableAdaptor.Update(AmenDataSet)

I am modifying the contents before the save button is clicked.

My database is called Amen.mdb , it has 3 tables, I draggeg one full
table onto the design surface (artiste table) and on my form VB
created all the fields for me which is cool, but I couldnt get the
update to work. I think im making a mistake with the SAVE button code
or i've missed something out. (I know i sound stupid here - It aint
great when you start is it!).

I have noticed though that VB 2005 has created

ArtisteDataConnector
AmenDataSet
ArtisteTableAdaptor
ArtisteDataNavigator - All buttons on this navigator work except the
Save button hence i've created my own.

The connection string is correct as the navigator skips through the
table displaying the contents of each record in the artiste table just
fine, in fact the whole thing works great except my suspect line on
the SAVE button.

I have created similar programs in VS.NET 2003 VB and im used to
creating a con and a set of Select Insert Update and Delete Commands
with no problems. Its far more work in 2003 but at least it works!
(loosing patience 2005).

Any help greatly appreciated.

Tino
 
Back
Top