sethindeed Posted February 6, 2003 Posted February 6, 2003 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 ? Quote What I don't know keeps me excited...
Leaders quwiltw Posted February 7, 2003 Leaders Posted February 7, 2003 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:) Quote --tim
sethindeed Posted February 7, 2003 Author Posted February 7, 2003 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) Quote What I don't know keeps me excited...
wyrd Posted February 7, 2003 Posted February 7, 2003 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. Quote Gamer extraordinaire. Programmer wannabe.
sethindeed Posted February 7, 2003 Author Posted February 7, 2003 Thanx for your help I finally solved my problem adding a data adapter to my form many thanx Quote What I don't know keeps me excited...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.