Understanding data access through comboboxes

Insert is a property you set in design view in the properties window easily.

I'm not entirely sure how you would go about doing it via code
 
I'm not entirely sure why a select would work once and not a second time. You've tried to clear the table.

The only thing I can think is that a Try Statement might be holding back the insert. Maybe if you tried a fill after the whole Try statement it might act differently.

Sounds similar to a transaction about how not everything is fully commited to a DB until after a transaction is ended.
 
No still no joy! I have tried the fill outside the try statement and no update to the dataset takes place!!!

I am totally totally stumped now! I don't know what else to try?
 
When the form loads you're using the same Fill method with the same SQL?

I'm running out of ideas
 
Yeah, I copy/pasted the line.

What I am trying now is deleting all the dataset, binding and table adapter stuff from design view and recreating from scratch just in case there is some corruption somewhere??

Will let you know what happens.......
 
I know sometimes you have to redo databinding at various points to get a combobox to recognize a change... but if the DataTable isn't finding all the new rows, thats annoying.

If it's a smallish sample project, you could post it and I could poke around a little. I know it sounds like the database table you're using seems really simple.
 
if you can tell me how to post it, or I can zip the project up and email to you?

It's doing my nut in! I deleted the stuff and recreated it all to no avail!!
 
You can zip it up and post it here with the paperclip button to the right of the Fonts on the a postings formatting bar.

You can email it to me at SlinkingFerret at gmail dot com also. Just make sure to remove the .exe files from all the directories
 
here is the project with the .exe files removed.

when you click on the detailed monthly tab the password is set to 123 for now.

the problem is when you try to save a new transaction description that should be reflected in the combo box above.

I tried to email it to you also but it bounces back...
 

Attachments

Last edited by a moderator:
Not sure why I should have to do it this way, but if it works dont knock it?

I removed all the guff from the design view and coded the lot and it works?

I created a tableadapter, commandbuilder and datatable and linked the combobox to this.

Now when I do the update it all works a treat ;)
 
Sorry, I tried your project and couldn't get it to run. Just something about the way you attached the MDB and ran it through SQL Express. Not something I was familiar with and even when I tried to attach it to SQL Server directly and use a new connection string, exceptions would still be thrown when running the app.

But I did take a look and I wasn't familiar with using a TableAdapter as you did on the form (I use them in a public method in the dataset), but your dataset was strongly typed and looked fine.

I'm glad you found out what the problem was... well you didn't really find out what the problem was, but I'm glad you found an alternate way of getting it done :)
 
Thanks, been away for a few days!!

Yes weird that I can't see why I should have to do it this way, but it works perfect so I am happy
 
Back
Top