Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  Known Bug - Possible Workaround?? (Tuesday, December 21, 2004)




Found the following interesting discussion in the Newsgroups:

Known Bug - Possible Workaround??
by:CJ Taylor

Alright, So this morning (as we are a week from launch on our product) I
come across an error as I add a simple thing to our system. A display
column in our dataset for databinding for display purposes only.

So everything goes smoothly, compile, start running, everything looking
good. then I go to update a row.. get a System.Data.Readonly exception.

I investigate further to find this is a known bug in the framework according
to many articles. Here is one if you want to read about it some..

http://www.error-bank.com/microsoft.public.dotnet.framework.windowsforms.databinding/_35_hcsyiv0dha.2328@tk2msftngp10.phx.gbl_Thread.aspx

So, I read the "workarounds" which are lame attempts to trick the framework
by removing expression columns from the datatable before the update, and
then add them back after the update.

Now to me... this sounds really dumb...

So I tried something. I attached to the RowUpdated and RowUpdating events
of my DataAdapter. Rowupdating provides nothing useful. However Row
Updated comes back with the Sql.Data.ReadonlyException

This sets the Status property of the
System.Data.SqlClient.SqlRowUpdatedEventArgs
to ErrorsOccured. However, I check the database and my fields were updated
as excpected. It's just the fact it can't change the Readonly property on
the expression column...

I don't care about that...

So I set the Status to continue if the error is of Data.ReadonlyException

No problems...

I return to the UI Layer... No problems... all changes updated as
expceted....

is there anything obvious I'm missing in this? Why this wouldn't work?

Comments appreciated.

Thanks,
CJ


 Reply:
by:OHM

 No problems, no problem !

OHM


 Reply:
by:CJ Taylor

 Ha! Like you this is not the answer I wanted.

Ok, then why does about 300 people agree that removing the expression
columns is the *best* way. There is no way that I figured out a better way
to do it. I'm just not that smart. =)


 Reply:
by:OHM

 I dont really have a good answer, other than if it works consistently, then
why worry about it. It's fixed in VS2005 probably anyway.

OHM


 Reply:
by:scorpion53061

 First of all good to hear from you again OHM. havent heard from you in a
while.

The challenge of overcoming the issue is the reason I will make myself
trying to fix a problem like that which CJ is dealing with.

Something like what happened to me with datatable.compute

Ask Mr.Ryan how crazy I drove him with that one!!








0 Comments:

Post a Comment

 
Previous Posts
    - Graph in VB.Net
    - Having problems migrating an ASP .net Page to ano...
    - VB.NET 2003 Standard Classes & DLL Creation
    - String concatenating for Dataset.compute method
    - Any VB/COM experts here??
    - The specified domain either does not exist or coul...
    - Measuring an angle
    - Unable to upgrade VB6 COM Dll to VB.Net
    - TypeConverter.CreateInstance-Method
    - vb.net & word

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006

Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland