no update performed

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
artistunknown
Posts: 7
Joined: Tue 07 Aug 2007 10:00

no update performed

Post by artistunknown » Tue 07 Aug 2007 10:15

hi there!

i have an mysqltableadapter an a select statement to fill a devexpress grid.well showing data from the database work well, but i cannot perfom an update/delete/insert on my tableadapter!
ive perfomring adapter.update(dataset) on each cellvalue changed, but no update is performed through the database (i have created the corresponding update/ins/deletioncommands as well). am i working the incorrect way with the adapter? do have to call a method to fill the parameters? can anyone give me advise how to perfom an update?

thanks in advance

AU


_______
VS 2005
crlab mysql connector for NET2

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 07 Aug 2007 13:09

What is meant by "mysqltableadapter"? TableAdapter or MySqlDataAdapter?
What is the name of the "grid" component? (Do you create WinForms or ASP.NET application?)

artistunknown
Posts: 7
Joined: Tue 07 Aug 2007 10:00

Post by artistunknown » Tue 07 Aug 2007 13:20

its an mysqldataAdapter.
the grid is called gridControlCustomer and contains a gridView called gridCustomer and a GridCard called gridCardCustomer.
it is a winform applcation.
Last edited by artistunknown on Tue 07 Aug 2007 21:57, edited 1 time in total.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 07 Aug 2007 13:49

Could you please provide the link to download such controls from?

artistunknown
Posts: 7
Joined: Tue 07 Aug 2007 10:00

Post by artistunknown » Tue 07 Aug 2007 14:18

im testing the devexpress .NET components right now...
find it here

[email protected]
Posts: 38
Joined: Tue 07 Mar 2006 17:13

Post by [email protected] » Tue 07 Aug 2007 15:09

AU,

Try the following:

Assuming your grid is called gridControlCustomer and the primary gridview is called viewControlCustomer, *before* you call your CoreLab component Update method....

viewControlCustomer.CloseEditor() 'close any open DevX editor the user may have open
viewControlCustomer.UpdateFocusedRecord() 'flush any edits to the current record
BindingContext.Item(viewControlCustomer.DataSource).EndCurrentEdit() 'flush any cached edits from the grid control to the datasource

- Now try your update command on the CoreLab component and see if it works.

Hope this helps,

John

artistunknown
Posts: 7
Joined: Tue 07 Aug 2007 10:00

Post by artistunknown » Tue 07 Aug 2007 16:08

[email protected]

thanks sooo much, this works so far!
although i dont have a bindingcontext, there is just the adapter and the dataset at designtime visible...did you ment the bindingSourceComponent?

[email protected]
Posts: 38
Joined: Tue 07 Mar 2006 17:13

Post by [email protected] » Tue 07 Aug 2007 18:50

I don't use a "bindingcontext" in my app either. This is the issue I opened early this year with DevExpress about the same topic and what they suggested:

https://www.devexpress.com/Support/Cent ... id=CQ11260

Somewhere along the way I picked up that bindingcontext thing from another support suggestion and now use it without error. I have no idea if it causes any problems. Most likely its just redundant somehow.

jh

[email protected]
Posts: 38
Joined: Tue 07 Mar 2006 17:13

Post by [email protected] » Tue 07 Aug 2007 18:57

As follow-up, look up the "BindingContext class" help topic under the ".NET framework" help category. I understand what they are talking about - I just don't know for sure if you have to use it in your code when you are using the DevExpress object.

jh

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 16 Aug 2007 08:29

artistunknown, I am testing the latest version of DevExpress componments now.
With MySqlDataTable component bound to the GridControl everything updates fine.
Did you receive any exception?
Have you already solved the problem?

artistunknown
Posts: 7
Joined: Tue 07 Aug 2007 10:00

Post by artistunknown » Fri 17 Aug 2007 11:56

Hey Alexey!

yes ive solved the problem right now. as John suggested, everything works just fine right now, although i will try your solution - so thanks for your post.

actually im working with the schedulers...lets see if there is a stumbling block too :)

i now recognized, that your solution causes some problems with the scheduler when trying to map all requiered field. the needed binding source does not catch the datamember from the datatablecomponent. You cannot use the "." syntax in mapping the fields.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 17 Aug 2007 15:05

Could you send me your project with schedulers to alexeyi at crlab dot com?

Post Reply