Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Concurrency algorithm
 

Concurrency algorithm

Hi,

anyone can help if you have a nice algorithm to solve dbconcurrency.

my code goes like this

try

{

this.TAInvoice.Update(this.Invoice);

this.TAInvoiceCharge.Update(this.InvoiceCharges);

transac.Commit();

}

catch(DBConcurrencyException DBC)

{

}

finally

{

TAInvoice.Connection.Close();

TAInvoice.Connection = null;

}

note that the table invoice is a parent and invoicecharges a child table.

i have set cascade on update and delete on the relation.

thanks.

hrub.

hrubesh  Tuesday, July 03, 2007 5:51 AM
Hi,

You can't manage database concurrency using this method. You will have to implement some type of row checking or compare your original values with currently saved database values and decide whether you want to save or not.

If no record is saved then raise some errors either from your SQL or .Net code.

Hope this will give you some clue.
Zafar Iqbal
ziqbalbh  Tuesday, July 03, 2007 7:38 AM

Hi thanks for the tip,

I also believe working with datasets could/would be having another way of solving things, up until now i am loving code minimisation techniques with datasets, batch updates. ,

Are you sure there are no other methodologies to handling concurrency using datasets, other than this., am sure there is..

any one else on this track?

thanks.

hrubesh  Tuesday, July 03, 2007 7:48 AM

You can use google to search for other answers

Custom Search

More Threads

• Binding KeyCollection of a Dictionary to a combobox?
• Adding new column to an Access database
• DataGridView: new column type in wizard
• Help me update a database! Please?
• DataGridViewCheckBoxColumn value not being set in data source
• Combobox data retrieval errror
• VS 2008 Linq InsertOnSubmit doesn't work.
• How to open a form showing a particular record, or new record ?
• Selecting multipe rows in a datagrid with rowfilter
• DataGridView - Displaying data in timetable format, not as format from database