Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

OK,

I am at a point where I can easily read the database with the datareader object but I am still unable to update, add or delete records.

I haven't found any simple sample code on this forum and I understand that once you understood the complex strucutre, you may not want to give it away just like that.

At this point, I have been able to fill a dataadapter with a dataset. BUt it seems that it is not enough...

Do I have to fill a data table with the dataset, then fill the datarow and datacolumn with the datatable.

Why 16 lines of code for what used to take 3 ?

Is it the price to pay for better software ?

Jokes apart, once my ole dataadapter ( I am using Access ) is filled, what is the next step ?

What I don't know keeps me excited...
  • Leaders
Posted

There are a number of tutorials on line but... if I were you I'd just use the DataAdapter wizard to create all the command objects needed, then just look at the generated code to learn from it. You'll instantly see opportunities to improve it.

 

btw, my guess is that you have been able to fill a dataset with a dataadapter, not the other way around:)

--tim
Posted

Now, I reached the point where I have to update my data adapter with modified data and I am getting the following error message :

 

Update requires a valid UpdateCommand when passed DataRow collection with modified rows...

 

Almost there...

 

my code is oleAdapt.Update(ds)

What I don't know keeps me excited...
Posted
You can use the CommandBuilder class to create the commands you need to update, add and delete from the database, then set the *Command properties to the specific command. After that's done you can update your database.
Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...