Click here to Skip to main content
15,890,186 members
Home / Discussions / Database
   

Database

 
GeneralRe: Transaction SQL help (SQL Server 2000) Pin
Colin Angus Mackay30-Sep-04 7:19
Colin Angus Mackay30-Sep-04 7:19 
GeneralRe: Transaction SQL help (SQL Server 2000) Pin
Matt Newman30-Sep-04 7:27
Matt Newman30-Sep-04 7:27 
GeneralRe: Transaction SQL help (SQL Server 2000) Pin
Colin Angus Mackay30-Sep-04 9:51
Colin Angus Mackay30-Sep-04 9:51 
GeneralRe: Transaction SQL help (SQL Server 2000) Pin
Matt Newman30-Sep-04 10:31
Matt Newman30-Sep-04 10:31 
GeneralADO memory leak Pin
Droiddr29-Sep-04 23:47
Droiddr29-Sep-04 23:47 
GeneralRe: ADO memory leak Pin
sreejith ss nair7-Oct-04 0:53
sreejith ss nair7-Oct-04 0:53 
GeneralRunning SQL Agent from VB.NET and getting execution status Pin
Emilio Crespo29-Sep-04 6:53
Emilio Crespo29-Sep-04 6:53 
Generalvery strange behaviour Pin
ricardojb29-Sep-04 5:54
ricardojb29-Sep-04 5:54 
I'll try to explain this.

I have a Windows form with a datagrid.

The datagrid binding has been set as MyDataGrid.SetDataBinding(MyDataView, "")

The dataview has also a RowFilter to show only some records.

Now, the problem is that I need to do some calculations whenever something is changed in that table.

For that I use the RowChanged and RowDeleted events.

Now, I have no problems with rows deleted, or rows that are modified, but I do with rows added.

When I add a new row, the RowChanged event does fire, and checking the row property of the event argument I can verify all the data in that row is correct.

However, a that point, all the dataset methods don't seem to "see" that row.

Very strange because the row is being showed on the datagrid.

More strange, if I make any other change, the row becomes "available".

It was driving me crazy because a Select method executed on the datatable would not return the newly added row, but it would if other change was made subsequently.

Just to be sure, in the RowChangedEvent I saved the dataset at that stage using the WriteXml method, then I looked at it and it did not include the new row.

But if I check the count property of the datatable, it has increased by one.

so D'Oh! | :doh: it seems that by the time the RowChangedEvent is fired, the row is not available to the dataset methods even though the row IS available to the dataview WTF | :WTF:

to make things even weirder. I have some code that checks for data integrity in the RowChanged event, if the data is wrong is display a message box and then calls the RejectChanges() method of the row.

That in turn triggers the event again and it exits the procedure because the row is null.

Now if that happens (meaning, if I enter wrong data to trigger the rollback) all subsequent insertions work fine.

even weirder, if I exclude the event handler before calling RejectChanges() (so the RowChanged event won't be trigger by the rollback) the problem persists, meaning new rows are not "seen".

this does not make any sense to me, and only happens if I do my calculations from the RowChanged event. If I add a button and use the button's click event it's fine, so it looks that when the RowChanged event is fired, the new row is in a sort of intermediate state (not the added state but some unforseen state).

This looks like a bug, but I really have no clue what's going on.

I hope this is understandable, it's so weird that I can't make any sense of it.
GeneralRe: very strange behaviour Pin
sreejith ss nair7-Oct-04 0:51
sreejith ss nair7-Oct-04 0:51 
GeneralStored Procedures and Return Values Pin
Ryan@SalamanderTechnologies29-Sep-04 3:53
sussRyan@SalamanderTechnologies29-Sep-04 3:53 
GeneralRe: Stored Procedures and Return Values Pin
Colin Angus Mackay29-Sep-04 4:41
Colin Angus Mackay29-Sep-04 4:41 
GeneralStored procedure / query optimization Pin
Vagif Abilov28-Sep-04 7:47
professionalVagif Abilov28-Sep-04 7:47 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell28-Sep-04 8:19
Steven Campbell28-Sep-04 8:19 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov28-Sep-04 8:52
professionalVagif Abilov28-Sep-04 8:52 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell28-Sep-04 9:48
Steven Campbell28-Sep-04 9:48 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov28-Sep-04 9:55
professionalVagif Abilov28-Sep-04 9:55 
GeneralRe: Stored procedure / query optimization Pin
Colin Angus Mackay28-Sep-04 23:12
Colin Angus Mackay28-Sep-04 23:12 
GeneralRe: Stored procedure / query optimization Pin
Bill Dean29-Sep-04 6:31
Bill Dean29-Sep-04 6:31 
GeneralRe: Stored procedure / query optimization Pin
Steven Campbell29-Sep-04 8:30
Steven Campbell29-Sep-04 8:30 
GeneralRe: Stored procedure / query optimization Pin
Colin Angus Mackay29-Sep-04 13:24
Colin Angus Mackay29-Sep-04 13:24 
GeneralRe: Stored procedure / query optimization Pin
Bill Dean30-Sep-04 2:21
Bill Dean30-Sep-04 2:21 
GeneralRe: Stored procedure / query optimization Pin
Jeremy Oldham29-Sep-04 13:50
Jeremy Oldham29-Sep-04 13:50 
GeneralRe: Stored procedure / query optimization Pin
Vagif Abilov29-Sep-04 19:40
professionalVagif Abilov29-Sep-04 19:40 
Generaleqivalent of "FOR UPDATE" Pin
WinDotNet27-Sep-04 19:35
WinDotNet27-Sep-04 19:35 
GeneralRe: eqivalent of "FOR UPDATE" Pin
Anonymous30-Sep-04 0:34
Anonymous30-Sep-04 0:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.